Help with the Simple Word Blacklist

By Hoshiru on Sep 01, 2014

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
  }
}

Comments

Sign in to comment.
Hoshiru   -  Sep 02, 2014

What i meant was more like, if you add "you are ugly" so the bot would timeout the person who actualy says "you are ugly" and not only if he says "you".

But i apprectiate your help :)

 Respond  
Herc08   -  Sep 01, 2014

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.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.