Blacklist

By Stewie1k94 on Feb 05, 2014

This is a Blacklist script I coded out, and decided to post it here too.

Commands: !blist add [Nick] [Reason]; !blist del [Nick] and !blist list

To use this script, add in:

if (!$readini(Blacklist.ini, $chan, $address($nick,2))) { 

To any snippet you wish to not let one use whilst added to the Blacklist!

Example:

on *:TEXT:*:#:{
  if ($1 == !example) {
    if (!$readini(Blacklist.ini, $chan, $address($nick,2))) {
      Whatever your script is goes here... I'm sure you get the point. xD
    }
    else { msg # You can't use this as you're added to the Blacklist. }
  }
}

Any suggestions or thoughts are welcome. :)

And, one last thing... Enjoy the snippet!

on *:TEXT:*:#:{
  if ($1-2 == !blist add) {
    var %address = $address($3,2)
    if ($readini(Blacklist.ini, $+($network,$chan), $address($3,2))) {
      msg # $nick $+ , the address $qt(%address) is already added to the blacklist! Reason: $readini(Blacklist.ini, $+($network,$chan), %address) 
    }
    else {
      if ($3) && ($4) {
        writeini Blacklist.ini $+($network,$chan) $address($3,2) $4- $+($chr(40),Added by $nick on $fulldate,$chr(41)) 
        var %BlacklistReason = $readini(Blacklist.ini, $+($network,$chan), %address)
        msg # $qt(%address) has been added to the blacklist! Reason: %BlacklistReason
      }
      else { msg # $nick $+ $chr(44) you need to specify the name/reason of the person to add to the blacklist! !blist add [Nick] [Reason] }
    }
  }
  if ($1-2 == !blist del) {
    if ($readini(Blacklist.ini, $+($network,$chan), $address($3,2))) {
      remini Blacklist.ini $+($network,$chan) $address($3,2)
      msg # $qt($address($3,2)) has been removed from the blacklist by $nick
    }
    else { msg # $nick $+ , $qt($address($3,2)) is not on the blacklist to remove. }
  }
  if ($1-2 == !blist list) {
    var %a = 1
    if (!$readini(Blacklist.ini, $+($network,$chan), $ini(Blacklist.ini, $+($network,$chan), %a))) msg # There is currently no-one added to the blacklist! 
    else {
      while (%a <= $ini(Blacklist.ini, $+($network,$chan), 0)) {
        inc %number 1
        msg # $+($chr(35),%number) $qt($ini(Blacklist.ini, $+($network,$chan), %a)) Reason: $readini(Blacklist.ini, $+($network,$chan), $ini(Blacklist.ini, $+($network,$chan), %a)))
        inc %a
      }
    }
  }
}

Comments

Sign in to comment.
H0LLYWOODIRC   -  Apr 12, 2014

great job so far.
does it allready work with multiple servers and channels?
if not, is there a way to make it work like that?
thanks for making a great snippet.

Stewie1k94  -  May 01, 2014

It works with multiple channels but I'm sure I can update it to work with server too. I will do that shortly and post a code update.

Edit: Code has been updated to work with different networks! :)

soloak  -  May 20, 2014

how do you get this to work i find if i put this anywhere in my remote scripts it doesn't work. If i put it in by it's self it does. Trying to add any other code at all doesn't work.

Sign in to comment

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.