Ban Finder

By Tidum on Nov 22, 2010

It triggers whenever a ban is set or removed. It goes through your ial(Internal Address List) to find the nick associated with the address. It'll echo the results in the channel with colours :D Hope you like it.

on *:BAN:#:banfinder
on *:UNBAN:#:banfinder
alias -l banfinder {
  var %x = 1
  var %nicks = $null
  while ($nick($active,%x)) {
    if ($banmask iswm $ial($banmask,%x)) {
      var %nicks $addtok(%nicks,$ialchan($banmask,$chan,%x).nick,32)
      inc %x
    }
    else {
      inc %x
    }
  }
  if (%nicks == $null) { halt }
  var %nicks = $replace(%nicks,$chr(32),$chr(44) $+ $chr(32))
  echo -t $chan $iif($event = ban,$+($chr(3),7,Ban),$+($chr(3),7,Unban)) $&
    of14 $banmask 07by14 $nick $+ ( $+ $remove($address($nick,1),*!*) $+ ) 07affects:14 %nicks $+ 07.
}

Comments

Sign in to comment.
Jethro   -  Nov 23, 2010

I've edited it and removed some unneeded strings.

 Respond  
Jethro   -  Nov 23, 2010

:P Gummo. Thanks for spotting that, but if you looked closely, the only suggestion I made was for Tidum to combine two same routines using an alias to save some bytes. I didn't even look at the actual, original code. I should have done so though. As you should have seen, I copied it straight from him. While I'm at it, I might as well take your word for it and fix it:

on *:ban:#:banfinder
on *:unban:#:banfinder
alias -l banfinder {
  var %x 1, %y $remove($address($nick,1),*!*)
  while $nick($active,%x) {
    if $banmask iswm $ial($banmask,%x) {
      var %nicks $addtok(%nicks,$ialchan($banmask,$chan,%x).nick,32)
      inc %x
    }
    echo -t # $iif($event = ban,$+($chr(3),7,Ban),$+($chr(3),7,Unban)) $&
      of14 $banmask 07by14 $nick $+ ( $+ %y $+ ) 07affects:14 %nicks $+ 07.
  }
}
 Respond  
Gummo   -  Nov 23, 2010

Jethro_ you /set %nicks once as well as /var %nicks twice. You should probably fix that up.

 Respond  
Tidum   -  Nov 22, 2010

Could've sworn I clicked on mIRC, ah well fixed. Also, thanks Jethro_, I'll update it.

 Respond  
Jethro   -  Nov 22, 2010

Well for starters, you don't need two routines, which they're doing the same thing anyway, per ban and unban event. This will do the trick just dandy:

on *:BAN:#:banfinder
on *:UNBAN:#:banfinder
alias -l banfinder {
  var %x = 1
  var %nicks = $null
  while ($nick($active,%x)) {
    if ($banmask iswm $ial($banmask,%x)) {
      set %nicks $addtok(%nicks,$ialchan($banmask,$chan,%x).nick,32)
      inc %x
    }
    else {
      inc %x
    }
  }
  if (%nicks == $null) { halt }
  var %nicks = $replace(%nicks,$chr(32),$chr(44) $+ $chr(32))
  echo -t $chan $iif($event = ban,$+($chr(3),7,Ban),$+($chr(3),7,Unban)) $&
    of14 $banmask 07by14 $nick $+ ( $+ $remove($address($nick,1),*!*) $+ ) 07affects:14 %nicks $+ 07.
}
 Respond  
Sorasyn   -  Nov 22, 2010

you sure this is BYOND?

 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.