SphereCommunity
Swearing Doest Trigger - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Swearing Doest Trigger (/Thread-Swearing-Doest-Trigger)



Swearing Doest Trigger - Runcuks - 11-17-2014 07:28 PM

Hello, i have this script but it doesnt fire when the bad word is sad alone for example if i say, " f*ck " - it doesnt trigger, but if i say- " f*ck that " it triggers as it should. Heres scp.


[SPEECH spk_player]
ON=*

if (!<isgm>)
local.ex=<explode \',<args>>
//local.ex=<explode \",<local.ex>>
db.query "SELECT `word` FROM `bad_words` WHERE ('<local.ex>' REGEXP `word`) = 1 LIMIT 0,1;"
if (<db.row.numrows>)
if !(<src.has_fun_events>)
src.sayua 00b00,0,0,0 I love you!
endif
if (<tag0.mat_count> < 5)
tag0.mat_count += 1
sysmessage @00b00 Abuse: <dtag.mat_count>
else
tag0.mat_count =
sysmessage @00b00 Punished, muted for 5 min
say @00b00 Punished: Abusive language
tag.mute=<serv.time>+300*10
tag.mute_t=1
endif
return 1
endif
endif


RE: Swearing Doest Trigger - Extreme - 11-17-2014 11:54 PM

I recommend use LIST for this. Imagine many people talking. It will flood your mysql connection then will slow sphere...


RE: Swearing Doest Trigger - Coruja - 11-18-2014 12:53 AM

sphere already have an internal engine for badword list, which is much more lightweight/fast than SQL
just add all badwords on [OBSCENE] section on spheretables.scp
and then you can check if someone said any badword using <eval IsObscene(<ARGS>)>


RE: Swearing Doest Trigger - Runcuks - 11-18-2014 01:36 AM

Ok Thanks Guys.

Corujas solution works like charm Smile