Jump to content

Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

 

def Run(self):
	res = self.GetText()
	#res = self.inputValue.GetText()  ## your input value
	try:
		fHandle = app.OpenTextFile("locale/en/block_words_python.txt")
		w = app.GetTextFileLineCount(fHandle)
	except IOError:
		dbg.LogBox("Error: Loading words !")
		app.Abort()

	for j in xrange(w):
		lc = app.GetTextFileLine(fHandle, j)
		c = str(lc).split("\t")
		if len(c) == 0 or not c[0]:
			continue	
		elif res == c[0]:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
			return

locale/en/block_words_python.txt

text0
text1
text2
text3
text4
text5
text6
text7
text8
text9
text10
text11
text12
text13
text14
text15

 

  • Metin2 Dev 3
  • Love 7
Link to comment
https://metin2.dev/topic/12287-py-function-global-block-words/
Share on other sites

8 minutes ago, galet said:

Hi,

Thanks, but why don't simply use the insult.txt file ? This is exactly the same thing (or almost)

Bro, this is not for words with offense etc, insult function is loaded from source It has nothing to do with it.

With this script you can add any tape you want to check text such as:
- Box friendship request
- Box declaring war
- Box quest input
- Any other box that includes a InputValue

You need only change:

szText = self.GetText()

With this:

szText = self.yourInputValue.GetText() # Obtaining the text that you wrote in the same box

You can play a lot with this little code is funny.

  • Love 1
  • Honorable Member

I do not know what is this and why need this, but the code is ugly a little. And what those commented lines are?
If you release smthg do not put inside unnecessary codes.

Here is a little code which is much sexier:

 

import app, chat
szText = "banword"

fHandle = app.OpenTextFile("locale/en/block_words_python.txt")
if not fHandle:
	return False

if szText in [app.GetTextFileLine(fHandle, i).strip() for i in xrange(app.GetTextFileLineCount(fHandle))]
	chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
	return

 

Edited by xP3NG3Rx
Idiot code tag, why not fix someone this fcking shit...?
  • Love 1
6 hours ago, xP3NG3Rx said:

I do not know what is this and why need this, but the code is ugly a little. And what those commented lines are?
If you release smthg do not put inside unnecessary codes.

Here is a little code which is much sexier:

 


import app, chat
szText = "banword"

fHandle = app.OpenTextFile("locale/en/block_words_python.txt")
if not fHandle:
	return False

if szText in [app.GetTextFileLine(fHandle, i).strip() for i in xrange(app.GetTextFileLineCount(fHandle))]
	chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
	return

 

Much better now, thanks for comment dude sexy.:lol:

 

And.. yeah code tag is *fcking shit*...

  • Love 1
  • 4 months later...
  • 11 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.