Ban finder

By Cados on Mar 11, 2010

I didn't make this snippet. It was made by sk68 I just edited it a little. Added a window to tell it. Added the address and server for people on multiple servers.

on *:BAN:#:{ var %n $nick(#,0)
  while (%n) {
    echo -a Ban done. Check @bans for info.
    if ($banmask iswm $address($nick(#,%n),5)) var %b $addtok(%b,$nick(#,%n),32)
    dec %n
  }
  if (%b) { window @Bans | aline @bans Ban of $banmask done on $chan on $server $+ ( $+ $network $+ ) by $nick $+ . | aline @bans This ban affects %b $+ . }
}
on *:UNBAN:#:{ var %n $nick(#,0)
  while (%n) {
    /echo -a Ban done. Check @bans for info.
    if ($banmask iswm $address($nick(#,%n),5)) var %b $addtok(%b,$nick(#,%n),32)
    dec %n
  }
  if (%b) { window @Bans | aline @bans Unban of $banmask done on $chan on $server $+ ( $+ $network $+ ) by $nick $+ . | aline @bans This ban affects %b $+ . }
}

Comments

Sign in to comment.
raccoon   -  Mar 12, 2010

It would be faster to iterate through $ialchan($banmask,#,0) rather than $nick(#,0).. especially on really large channels.

There are a few bugs with this code. For one, it will say "Ban done" multiple times for the number of users who are affected by the ban. If someone set a ban !@*, it will flood your screen. Honestly, this code is rather broken because of that.

And don't forget, you need to have seen the address of every user in the channel, at least once, before this script will work 100%. This typically means performing a /who # sometime after joining the channel. From that point, mIRC will remain synchronized with all new users joining/parting the channel.

Of course, since most users get banned for 'doing something', that simple act of 'doing' (ie. typing, joining multiple times, deopping users, etc) will reveal their address to mIRC prior to the ban... so 99% of the time it won't be an issue if you don't /who # first.

On *:BAN:#:{
  ; initialize a couple variables.
  var %i = 1
  var %nicks
  ; iterate through all users affected by the ban.
  WHILE $ialchan($banmask,$chan,%i).pnick {
    ; create our list. $ifmatch references the above $ialchan.
    var %nicks = %nicks $ifmatch
    inc %i
  }
  ; sort the nicknames alphabetically with ops and voices first.
  var %nicks = $sorttok(%nicks,32,c)
  ; number of users affected by ban is %i minus 1.
  var %count = %i - 1
  ; if any nicks are affected, display that information in the channel
  if %nicks {
    echo -tic info $chan * This ban affects %count user(s): %nicks
  }
}  

The above code performs differently from yours, but it's intended as a bases for you to build off of. You could even choose to deop $nick (the op placing the ban) if %count is too high (the ban affects too great a percentage of the channel, eg !@*).

 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.