Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 11:14

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Mini-Release] Function global for block words

Discussion on [Mini-Release] Function global for block words within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Lightbulb [Mini-Release] Function global for block words

Code:
	import dbg, app, chat
		szText = self.GetText()
		#szText_ = self.inputValue.GetText()  ## your input value
		
		try:
			szGetFile = app.OpenTextFile("locale/en/block_words_python.txt")
			count_words = app.GetTextFileLineCount(szGetFile)
		except IOError:
			dbg.LogBox("Error: Loading words !")
			app.Abort()

		for vegas in xrange(count_words):
			lineText = app.GetTextFileLine(szGetFile, vegas)
			szGetTextFromFile = str(lineText).split("\t")
			if len(szGetTextFromFile) == 0 or not szGetTextFromFile[0]:
				continue	
			if szText == szGetTextFromFile[0]:
				chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
				return
			#if szText == szGetTextFromFile[0] and szText.find("b") != -1:
				#chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Check Function Test 1!")
				#return
			#iText = szGetTextFromFile[0]
			#if text and iText.find(" ") != -1:
			#if szGetTextFromFile[0] and text.find("a"):
			#if iText.strip().split(" ")[1] == text[-1:]:
			#test = self.GetText()
			#if szGetTextFromFile[0]:
				#if test.find(" "):
				#szText = szText.replace(" ", "____")
					#chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Check Function Test 2!")
					#return
			#if szText.find("vegas") != -1:
				#iText = str(iText).replace(" ", "pythonX")
locale/en/block_words_python.txt

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

-------------------------
Method 2 (xP3NG3Rx):

Code:
	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
VegaS ♆ is offline  
Thanks
6 Users
Old 06/22/2016, 16:34   #2
 
elite*gold: 0
The Black Market: 105/0/0
Join Date: May 2016
Posts: 8,679
Received Thanks: 1,638
Thanks
悪地城 is offline  
Thanks
1 User
Old 06/22/2016, 23:32   #3
 
elite*gold: 0
Join Date: Nov 2011
Posts: 395
Received Thanks: 29
thanks
Laben is offline  
Thanks
1 User
Old 06/24/2016, 23:12   #4


 
elite*gold: 1810
Join Date: Jan 2012
Posts: 2,208
Received Thanks: 1,630
Pretty useless, have a watch in locale\**\insult.txt. As you can see it's almost the same.
MaxChri is offline  
Thanks
1 User
Old 06/25/2016, 00:33   #5
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Thumbs up

Quote:
Originally Posted by MaxChri View Post
Pretty useless, have a watch in locale\**\insult.txt. As you can see it's almost the same.
With this script you can add any tape you want to check text such as:
- Box friendship request
- Box declaring war
- Box quest input
- You can block other value like a number 9,123,42,etc etc, or other sentence or words etc.
- Any other box that includes a InputValue

You need only change:
Code:
​
szText = self.GetText()
​
With this:
Code:
szText = self.yourInputValue.GetText() # Obtaining the text that you wrote in the same box
----------

And about ''As you can see it's almost the same.''

For loaded insult you need to load like this:
Code:
		if net.IsChatInsultIn(text):
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
Code:
bool CInsultChecker::IsInsultIn(const char* c_szLine, UINT uLineLen)
{
	for (UINT uPos=0; uPos<uLineLen;)
	{
		BYTE bChr=c_szLine[uPos];
		if (bChr & 0x80)
		{
			if (__IsInsult(c_szLine+uPos))
				return true;
			uPos+=2;
		}
		else
		{
			if (__IsInsult(c_szLine+uPos))
				return true;
			uPos++;
		}
	}
	return false;
}
I apologize for my English, a beautiful day still.
VegaS ♆ is offline  
Thanks
4 Users
Old 06/25/2016, 00:42   #6
 
fcsk_aim's Avatar
 
elite*gold: 100
Join Date: Dec 2014
Posts: 93
Received Thanks: 51
Quote:
Originally Posted by MaxChri View Post
Pretty useless, have a watch in locale\**\insult.txt. As you can see it's almost the same.
Where is dislike button when you need it ?
fcsk_aim is offline  
Reply

Tags
epvp, metin2, python, vegas


Similar Threads Similar Threads
[Mini-Release] OfflineShop - Function open <Bug fix>
06/21/2016 - Metin2 PServer Guides & Strategies - 6 Replies
- #1.) Add this: ​ #define __OFFLINE_SHOP_FIX_OPEN #define __OFFLINE_SHOP_VALUE_MAX 2000000000 #define __OFFLINE_SHOP_WARNING " Have more than 2.000.000.000 Yang!" -
[Mini-Release] Crit, Speed, Block, Hit Anzeige bei CharInfo
12/05/2014 - Flyff PServer Guides & Releases - 44 Replies
Screen http://www.hostingpics.net/viewer.php?id=472715Ca pture.png Code ################### # WndField.cpp # ###################



All times are GMT +1. The time now is 11:16.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.