Raised This Month: $51 Target: $400
 12% 

REGEX Word Filter


Post New Thread Reply   
 
Thread Tools Display Modes
depthbomb
Junior Member
Join Date: Jul 2014
Old 01-18-2017 , 19:56   Re: REGEX Word Filter
Reply With Quote #171

Does anyone know why the following doesn't quite work. It successfully kicks the offenders but doesn't block their message despite it being set to. I decided to try to block the entire message instead of replacing the offending word because even the replacing stopped working when I switched from blocking plain strings to blocking patterns.

Code:
"BlockAlot"
{
	"chatpattern"		"\bf[\s_\-.,+^*#&:;~$!\`%]*?[a4@]+[\s_\-.,+^*#&:;~$!\`%]*?[a4]*?[\s_\-.,+^*#&:;~$!\`%]*?[gq9] 'CASELESS'"

	"chatpattern"		"\bf[\s_\-.,+^*#&:;~$!\`%]*?[e3]+[\s_\-.,+^*#&:;~$!\`%]*?[a4]*?[\s_\-.,+^*#&:;~$!\`%]*?[gq9]\b 'CASELESS'"

	"chatpattern"		"f[\s_\-.,+^*#&:;~$!\`%]*?[a4@]+[\s_\-.,+^*#&:;~$!\`%]*?[a4@]*?[\s_\-.,+^*#&:;~$!\`%]*?[gq9]+?[\s_\-.,+^*#&:;~$!\`%]*?[gq9]*?[o0aei]+?[\s_\-.,+^*#&:;~$!\`%]*?t 'CASELESS'"

	"chatpattern"		"\bn[\s_\-.,+^*#&:;~$!\`%]*?[i1!l][\s_\-.,+^*#&:;~$!\`%]*?[gq9]\b 'CASELESS'"

	"chatpattern"		"\bn[\s_\-.,+^*#&:;~$!\`%]*?[i1!l][\s_\-.,+^*#&:;~$!\`%]*?[gq9][\s_\-.,+^*#&:;~$!\`%]*?[gq9]*?[\s_\-.,+^*#&:;~$!\`%]*?[a4@][\s_\-.,+^*#&:;~$!\`%]*? 'CASELESS'"

	"chatpattern"		"\bn[\s_\-.,+^*#&:;~$!\`%]*?[i1!l][\s_\-.,+^*#&:;~$!\`%]*?[gq9][\s_\-.,+^*#&:;~$!\`%]*?[gq9]*?[\s_\-.,+^*#&:;~$!\`%]*?[e3a4@][\s_\-.,+^*#&:;~$!\`%]*?r\b[.?s!\s,:;~]? 'CASELESS'"

	"chatpattern"		"\b[s5][\s_\-.,+^*#&:;~$!\`%]*?p[\s_\-.,+^*#&:;~$!\`%]*?[iyl|1!][\s_\-.,+^*#&:;~$!\`%]*?[ck(]\b[.?s!\s,:;~]? 'CASELESS'"

	"chatpattern"		"[c(][\s_\-.,+^*#&:;~$!\`%]*?h[\s_\-.,+^*#&:;~$!\`%]*?[1il|!y][\s_\-.,+^*#&:;~$!\`%]*?n[\s_\-.,+^*#&:;~$!\`%]*?[kc] 'CASELESS'"

	"block"			"1"
	"action"		"sm_kick #%u Auto-kicked for racist/discriminatory language;sm_isay %n was auto-kicked for racial/discriminatory language!;sm_say %n was auto-kicked for racial/discriminatory language!"
}
(Ignore the noob-tier patterns, I am still learning Regex.)

Here is a screenshot from the HLSW chatlog showing that this player's message didn't get blocked (though he still got kicked from the action).

__________________

Last edited by depthbomb; 01-18-2017 at 19:58.
depthbomb is offline
Dragonisser
AlliedModders Donor
Join Date: Jan 2014
Location: Germany
Old 05-11-2017 , 17:25   Re: REGEX Word Filter
Reply With Quote #172

How can i block and limit a string? It wont work no matter which order i have it.
Dragonisser is offline
EMINEM_FB
Senior Member
Join Date: Dec 2010
Location: Czech republic
Old 09-01-2017 , 15:01   Re: REGEX Word Filter
Reply With Quote #173

Block valve colors (chars???)
If is not blocked ( // ) lightbluee and blue it will break all other filters
Attached Files
File Type: sp Get Plugin or Get Source (sm_regexfilter.sp - 312 views - 11.5 KB)
File Type: smx sm_regexfilter.smx (10.8 KB, 212 views)
File Type: cfg regexrestrict.cfg (714 Bytes, 251 views)
__________________

Last edited by EMINEM_FB; 09-01-2017 at 15:08.
EMINEM_FB is offline
Kammi_
AlliedModders Donor
Join Date: Dec 2007
Old 10-15-2017 , 09:42   Re: REGEX Word Filter
Reply With Quote #174

i get this errors on cs:s

Code:
L 10/15/2017 - 15:41:12: [SM] Exception reported: Invalid Handle 0 (error 4)
L 10/15/2017 - 15:41:12: [SM] Blaming: sm_regexfilter.smx
L 10/15/2017 - 15:41:12: [SM] Call stack trace:
L 10/15/2017 - 15:41:12: [SM]   [0] GetTrieValue
L 10/15/2017 - 15:41:12: [SM]   [1] Line 127, /home/groups/sourcemod/upload_tmp/phpDgNNCg.sp::Command_SayHandle
config

Code:
"Censor"
{
	"white"
	{
        "chatpattern"    "\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}:?\d*"
        "replace"        "[censored]"   
        "warn"            "Don't advertise your IP here"   
        "limit"            "1" 
		"block"			"1"
        "punish"        "sm_ban #%u 60 Advertising other servers (1 Hour Ban)"
	}
	"teamcolor"
	{
        "chatpattern"        "hitler 'CASELESS'"
		"chatpattern"        "adolf 'CASELESS'"
		"chatpattern"        "sieg heil 'CASELESS'"
		"chatpattern"        "kurwa 'CASELESS'"
		"chatpattern"        "huso 'CASELESS'"
		"chatpattern"        "hurensohn 'CASELESS'"
		"replace"        "[censored]"
		"block"			"1"
		"limit"            "0" 
		"punish"        "sm_ban #%u 10080 Racial/Swering (1 week Ban)"
	}
	"red"
	{
        "chatpattern"    "[a-zA-Z0-9]*\.?[a-zA-Z0-9]*\.[a-zA-Z]{2,3}"
        "replace"        "[censored]"   
        "warn"            "Don't advertise your DNS here"   
        "limit"            "1" 
		"block"			"1"
        "punish"        "sm_ban #%u 60 Advertising other servers (1 Hour Ban)"
	}
	
}
__________________




Last edited by Kammi_; 10-15-2017 at 09:52.
Kammi_ is offline
Send a message via ICQ to Kammi_
napster_10
Senior Member
Join Date: May 2016
Old 12-24-2018 , 16:40   Re: REGEX Word Filter
Reply With Quote #175

hi,

how can i fix that?

Code:
L 12/24/2018 - 16:37:47: [SM] Exception reported: Array index out-of-bounds (index 35, limit 33)
L 12/24/2018 - 16:37:47: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:37:47: [SM] Call stack trace:
L 12/24/2018 - 16:37:47: [SM]   [1] Line 71, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientConnect
L 12/24/2018 - 16:37:49: [SM] Exception reported: Array index out-of-bounds (index 36, limit 33)
L 12/24/2018 - 16:37:49: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:37:49: [SM] Call stack trace:
L 12/24/2018 - 16:37:49: [SM]   [1] Line 71, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientConnect
L 12/24/2018 - 16:41:13: [SM] Exception reported: Array index out-of-bounds (index 33, limit 33)
L 12/24/2018 - 16:41:13: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:41:13: [SM] Call stack trace:
L 12/24/2018 - 16:41:13: [SM]   [1] Line 77, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientDisconnect
napster_10 is offline
Doulos
AlliedModders Donor
Join Date: Aug 2007
Old 12-01-2019 , 20:21   Re: REGEX Word Filter
Reply With Quote #176

Hello, I can't seem to get this plugin to ban as action, or punishment. What am I doing wrong??????
Here is the latest attempt:
Code:
"Censor"
{
	"Ban for offensive words"
	{
		"chatpattern"		"fuck 'CASELESS'"
		"replace"               "No, nope, bye"
		"punish"	        "sm_ban #%u 0"
	}
}
MetaMod:Source v1.10.7-devV
SourceMod v1.10.0.6451

Also getting errors:
Code:
L 12/01/2019 - 19:48:45: [SM] Exception reported: Array index out-of-bounds (index 33, limit 33)
L 12/01/2019 - 19:48:45: [SM] Blaming: sm_regexfilter.smx
L 12/01/2019 - 19:48:45: [SM] Call stack trace:
L 12/01/2019 - 19:48:45: [SM]   [1] Line 77, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientDisconnect
L 12/01/2019 - 20:04:19: [SM] Exception reported: Array index out-of-bounds (index 34, limit 33)
L 12/01/2019 - 20:04:19: [SM] Blaming: sm_regexfilter.smx
L 12/01/2019 - 20:04:19: [SM] Call stack trace:
L 12/01/2019 - 20:04:19: [SM]   [1] Line 77, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientDisconnect
L 12/01/2019 - 20:04:19: Error log file session closed.
L 12/01/2019 - 20:04:20: SourceMod error session started
L 12/01/2019 - 20:04:20: Info (map "ea_cbble_christmas") (file "errors_20191201.log")
L 12/01/2019 - 20:04:20: [SM] Exception reported: Array index out-of-bounds (index 34, limit 33)
L 12/01/2019 - 20:04:20: [SM] Blaming: sm_regexfilter.smx
L 12/01/2019 - 20:04:20: [SM] Call stack trace:
L 12/01/2019 - 20:04:20: [SM]   [1] Line 71, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientConnect

Last edited by Doulos; 12-01-2019 at 21:19.
Doulos is offline
djded
Member
Join Date: Jul 2019
Location: Czech Republic
Old 12-18-2019 , 07:22   Re: REGEX Word Filter
Reply With Quote #177

Quote:
Originally Posted by napster_10 View Post
hi,

how can i fix that?

Code:
L 12/24/2018 - 16:37:47: [SM] Exception reported: Array index out-of-bounds (index 35, limit 33)
L 12/24/2018 - 16:37:47: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:37:47: [SM] Call stack trace:
L 12/24/2018 - 16:37:47: [SM]   [1] Line 71, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientConnect
L 12/24/2018 - 16:37:49: [SM] Exception reported: Array index out-of-bounds (index 36, limit 33)
L 12/24/2018 - 16:37:49: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:37:49: [SM] Call stack trace:
L 12/24/2018 - 16:37:49: [SM]   [1] Line 71, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientConnect
L 12/24/2018 - 16:41:13: [SM] Exception reported: Array index out-of-bounds (index 33, limit 33)
L 12/24/2018 - 16:41:13: [SM] Blaming: sm_regexfilter.smx
L 12/24/2018 - 16:41:13: [SM] Call stack trace:
L 12/24/2018 - 16:41:13: [SM]   [1] Line 77, /home/groups/alliedmodders/forums/files/1/5/9/9/26953.attach::OnClientDisconnect
Have the same errors((
djded is offline
Doulos
AlliedModders Donor
Join Date: Aug 2007
Old 01-03-2020 , 02:17   Re: REGEX Word Filter
Reply With Quote #178

I finally got this to ban players by using "action" instead of "punishment".
Code:
"action"	"sm_ban #%u 0 Language"
Doulos is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 01-05-2020 , 07:57   Re: REGEX Word Filter
Reply With Quote #179

Is there no whitelist for this? :/
Ejziponken is offline
Doulos
AlliedModders Donor
Join Date: Aug 2007
Old 01-12-2020 , 20:55   Re: REGEX Word Filter
Reply With Quote #180

Updated the original plugin to 64 players and updated code to remove compile warnings. Compiled under sourcemod-1.10.0-git6460-windows. Only tested it on CS:S.
Attached Files
File Type: smx sm_regexfilter.smx (9.3 KB, 86 views)
File Type: sp Get Plugin or Get Source (sm_regexfilter.sp - 266 views - 11.5 KB)
Doulos is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode