Power Banholder

By ReQueST on Aug 12, 2004

This snippets holds a users ban, and sorts of blacklist him at the same time.
Its easy to use, you just ban a user on a channel. And he's in the "ShitList"
If someone else attempts to unban that user, address, you'll add the ban back.
To unban it, you just remove it. So ONLY YOU can unban a banned user. ( Ban must b set by you! Else every Op can unban.)
To view people/addresses who are currently banned: "/remban view"
Manual remove a ban: "/remban address (or) nick"

I also have build in an auto-kicker when someone bans.
And an echo that says who matches the ban on what channel.

NEWLY ADDED:
_1_ If a user joins who is in the channels banlist,.. It will kick him, and says why, by who and when he was banned.
_2_ Added some anti-flood options in the bannings, still have to write some additional protections. (Uses timers, so i'm not quite happy with that)
_3_ Added alias "/banlist #channel" this little alias will say all the bans in the channel, (timered to prevent flooding), one by one and says who set it, and when it was set.
_4_ Added alias "/bancheck [-b|-l]" Useing the -b parameter allows you to add all the bans you have in the list, to the current active channel. (You must be opped ofcourse). Useing the -l parameter allows you to tell others what address you ban, by naming them 1 by 1.

TO DO LIST:
A dialog to configure this script better and a better lay out. Its a bit messy still and not yet fully flood protected.

on *:JOIN:*:{
  var %a = 0, %t = 9
  while (%a <= %t) {
    if ($address($nick,%a) isin %banadr) && ($me isop #) { 
      /kick $nick BLACKLISTED (( $+ $address($nick,%a) $+ ) If you feel this is an error, message me.) 
      ban $chan $address($nick,%a) 
    }
    inc %a
  }
  var %b = $ibl(#,0)
  while (%b) {
    if ($ibl(#,%b) iswm $address($nick,5)) && ($me isop #) { kick $nick BANNED (Matching channel ban: $ibl(#,%b) $+ , set by: $iif($ial($ibl(#,%b).by,0).nick ison #,$ial($ibl(#,%b).by,0).nick,$ibl(#,%b).by) $+ , at: $ibl(#,%b).date $+ ) }
    dec %b 
  }
}

on *:ban:#: {
  if ($banmask iswm $address($me,5) && $me isop #) { 
    if (%baction == $null) { set %baction 0 }
    if (%baction <= 0) {
      inc -u15 %baction 1
      inc %kick.count 1
      /raw mode # -ob+b $nick $banmask $+($$address($nick,3),$crlf,kick $chan $nick :,DONT BAN ME!) $kc
      inc %ban.number 1
    }
  }
  if ($nick == $me) { if ($istok(%banadr,$banmask,1,32) == $false) { set %banadr %banadr $banmask $+ $chr(32) } }
  var %i = 1, %affect
  while ($ialchan($banmask,$chan,%i).nick) {
    %affect = %affect $ialchan($banmask,$chan,%i).nick $+ $chr(32)
    if (%bkaction == $null) { set %bkaction 0 }
    if (%bkaction <= 3) {
      inc -u15 %bkaction 1
      if ($me isop #) && ($ialchan($banmask,$chan,%i).nick != $me) { kick $ialchan($banmask,$chan,%i).nick Banned (Matching: $banmask $+ , set by: $nick $+ ) } 
    }
    inc %i 1
  }
  if (%affect) {
    echo 12 -agt * Ban ( $+ $banmask $+ ) affects: $iif(!$gettok(%affect,2,32),$remove(%affect,$chr(44)),%affect) $+ , on $chan $+ .
  }
}

on *:unban:#: {
  if ($matchtok(%banadr,$banmask,1,32) == $banmask) && ($nick != $me) && ($me isop #) { 
    /mode # +b $banmask 
    while ($ialchan($banmask,$chan,%i).nick) {
      if (%bkaction == $null) { set %bkaction 0 }
      if (%bkaction <= 3) {
        inc -u15 %bkaction 1
        if ($me isop #) && ($ialchan($banmask,$chan,%i).nick != $me) { kick $ialchan($banmask,$chan,%i).nick Banned (Matching: $banmask $+ , set by: $nick $+ ) } 
      }
      inc %i 1
    }
  }
  if ($nick == $me) { /remban $banmask }
}

alias remban {
  if ($1 == view) { /echo -a 9Your currently banning: $iif(%banadr,%banadr,Nobody.) }
  if ($1 == $null) { echo -a 9Enter a banmask to remove! (Case senstive) }
  elseif ($istok(%banadr,$1,1,32) == $true) {
    echo 12 -agt * Removed Banmask Succesfully
    set %banadr $remtok(%banadr,$1,1,32) 
  }
}

alias banlist {
  say # contains: $ibl($1,0) bans.
  var %b.tot = $ibl($1,0), %a = 1
  while (%a <= %b.tot) {
    .timer 1 %a say Ban $chr(35) $+ %a $+ : $ibl($1,%a) $+ , by: $ibl($1,%a).by $+ , when: $ibl($1,%a).date $+ .
    inc %a
  }
}

alias banCheck {
  var %all = $numtok(%banadr,32)
  while (%all) {
    $iif($$1 == -b,.timer 1 %all /mode # +b,$iif($$1 == -l,.timer 1 %all say Ban $chr(35) $+ $iif($len(%all) <= 1,0 $+ %all,%all) $+ :)) $gettok(%banadr,%all,32)
    dec %all
  }
}

Comments

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.