Hello.
I didnt make the Snippet but i am trying to modify it so that you can also add phrases into the blacklist.
Can someone tell me how to do it?
on *:TEXT:!blacklist add*:#: {
if ($nick isop #) {
set %blacklist. $+ $3 $+ . $+ $chan On
msg # $3 Has been added to my blacklist, anyone using $3 will be timed out for 3 minutes.
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
}
}
on *:TEXT:!blacklist del*:#: {
if ($nick isop #) {
unset %blacklist. $+ $3 $+ . $+ $chan On
msg # $3 Has been removed from the blacklist
}
else {
msg # Sorry $nick $+ , you do not have permission to remove words from my blacklist
}
}
on *:TEXT:*:#: {
if ($nick isop #) return
var %i = 1
while (%i <= $0) {
if ($($+(%,blacklist.,$gettok($1,$+,32),.,#),2)) {
msg # $nick $read(blacklistanto.txt)
msg # .timeout $nick 180
break
}
inc %i
}
}
Well it's been a few years since I've done mSL. But there is no reason to go using a while loop when you can use $istok. Also, adding words are not really adding. It is more making it the ONLY work. let's see pink was a bad word, it would say %blacklist.pink.#chan Well, we want to add blue as a bad word as well. Instead of %blacklist.pink.blue.#chan, it would reaplce pink with blue. The best way to do this is to set %blacklist $instok(%blacklist,$3,-1,46). This adds it all the way to the right, right before channel name.