Bad Word Kick
on *:text:*:#channel: {
if (sex iswm $1-) || (fuck iswm $1-) || (cunt iswm $1-) || (ass iswm $1-) {
inc %x 1
kick $chan $nick No bad word here - No - %x | mode $chan +b $wildsite
msg $nick Blacklist Word from me 4Sex , Cunt , Fuck , Asshole
}
}
heh, I like to add things to groups, easy to turn on/off
#swear.prot off
on @*:TEXT:*:#: {
if ($nick isreg $chan) {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
inc %i
var %current.word = $gettok(%swear.words,%i,32)
if ($istok($strip($1-),%current.word,32) == $true) {
ban -ku300 # $nick 2 Swear Word Detected.
}
}
}
}
#swear.prot end
menu channel {
-
Swear Protection.
.On://.enable #swear.prot | echo 4 -at * Your Current Set Swear Words are: %swear.words
.Off://.disable #swear.prot | echo 4 -at * Disabled Swear Protection.
.Set Swear Words://unset %swear.words | set %swear.words $$?="Enter Swear Words - Reset ALL Again (with spaces)"
.-
}
Similar method to others posted here, basic channel menu included.
Have you tried using $gettok as solitude posted? It matches anything, even if it's not a bad word. I think an alternative should be:
on @*:TEXT:*:#: {
var %x = 1, %y = ass fark sex
while ($numtok(%y,32) >= %x) {
if ($wildtok($strip($1-),$gettok(%y,%x,32),0,32)) {
ban -k $chan $nick 2 No badwords!
}
inc %x
}
}
Actually using $findtok will match exactly the bad words themselves only, so $wildtok is necessary for the script to catch them in a sentence.
Solitude, using $gettok will trigger the on text event every time, even if words differ from the bad words in the matching range:
on *:text:*:#:if ($gettok(fark ass sex,$1-,32)) echo -a true
hello true hello true testing trueAs you can see, it will match whatever. You should use $findtok:
if ($findtok(fark ass sex,$strip($1-),1,32)) {