Ban Finder

By Gummo on Nov 11, 2009

This is my ban finder, obviously. I'm not sure how many of the majority of the hawkee members will find it useful, but I sure did. :P
Basically, you type /findban [#channel] nick (#channel isn't required if you are in the desired channel already).
It will do a /whois on the nick you specified and then tell you any bans present in #channel matching the user to easily unban them or find who banned them, etc. applying to their nick/ident/host/realname.
If you are an IRCop then it will also compare their IP address and usermodes.
Works for normal bans as well as ~c ~n ~r ~f special bans.
Enjoy. :D

Don't rip. :P

alias findban {
  if (%findban.on) && (!$?!="The findban variables are still set. Are you sure you want to start it again?") return
  var %chan $iif(#* iswm $1,$1,$chan)
  if ($me !ison %chan) {
    echo 14 -ag Findban: 4ERROR: You're not on channel %chan
    return
  }
  unset %findban.*
  set -e %findban.on %chan
  !whois $iif(#* iswm $1,$2,$1)
}
raw 311:*: {
  if (%findban.on) {
    set -e %findban.address $+($2,!,$3,@,$4)
    set -e %findban.name $replace($6-,$chr(32),_)
  }
}
raw 378:*: {
  if (%findban.on) {
    set -e %findban.host $+($gettok(%findban.address,1,64),@,$gettok($6,-1,64))
    set -e %findban.ip $+($gettok(%findban.address,1,64),@,$7)
  }
}
raw 379:*:if (%findban.on) set -e %findban.umode $6
raw 319:*:if (%findban.on) set -e %findban.rooms $regsubex($3-,/(?<!\S)[^#]+/g,)
raw 318:*: {
  if (%findban.on) {
    echo 14 -ag Findban: $+(--=,$chr(123),Using Gummo's ban finder on $v1 for $2,$chr(125),=--)
    var %chan $v1, %a 1, %b $ibl(%chan,0)
    if ($chan(%chan).ibl) {
      while (%a <= %b) {
        var %mask $ibl(%chan,%a), %mask2 $gettok(%mask,-1,58)
        if ((~c:* iswm %mask) && ($wildtok(%findban.rooms,%mask2,0,32))) || ((~r:* iswm %mask) && (%mask2 iswm %findban.name)) || ($wildtok(%findban.address %findban.host %findban.ip,%mask2,1,32)) {
          echo 14 -ag Findban:6 %mask by6 $gettok($ibl(%chan,%a).by,1,33) - $duration($calc($ctime - $ibl(%chan,%a).ctime)) ago.
        }
        inc %a
      }
    }
    else echo 14 -ag Findban: 4ERROR: Internal ban list for %chan hasn't loaded. Please type /mode %chan +b and try again.
    var %m $gettok($chan(%chan).mode,1,32)
    if (i isincs %m) echo 14 -ag Findban:6 %chan is set to invite-only.
    if (%findban.umode) {
      if (R isincs %m) && (r !isincs %findban.umode) echo 14 -ag Findban:6 Only registered users are allowed in %chan $+ .
      if (z isincs %m) && (z !isincs %findban.umode) echo 14 -ag Findban:6 Only SSL users are allowed in %chan $+ .
      if (O isincs %m) && (o !isin %findban.umode) echo 14 -ag Findban:6 Only IRCops are allowed in %chan $+ .
      if (A isincs %m) && (a !isin %findban.umode) echo 14 -ag Findban:6 Only IRCop admins are allowed in %chan $+ .
    }
    echo 14 -ag Findban: End of results.
    unset %findban.*
  }
}

Comments

Sign in to comment.
Gummo   -  Nov 17, 2009

Thanks guys. :)
@FordLawnmower, I like to see the /whois info as well. Saves me having to do it twice. ;)
EDIT: Also lets me know that it's working, lol.

 Respond  
Cracker200   -  Nov 13, 2009

@ John ahhhh okay

 Respond  
FordLawnmower   -  Nov 13, 2009

Nice useful code Gummo :)
You could definitely improve this by halting all possible output from the whois call.

 Respond  
Ghost-writer   -  Nov 13, 2009

EL YOUR LIKE FAMOUS :O

 Respond  
JohnSmith   -  Nov 13, 2009

Yeah i don't know you either, why?, cause i moved from where i was and didnt have net and sorta spent way too much time on irc to begin with.

 Respond  
Cracker200   -  Nov 13, 2009

Yup, i don't know you @ all tho i mean i aint been here that long so i wouldn't But why did you Quit IRC?

 Respond  
JohnSmith   -  Nov 13, 2009

Im old, was here for awhile, sorta quit IRC, randomly came here again just to see what was up. Old name is EL, few of the other ppl mite remember. Glad to see a lot of new people.

 Respond  
Cracker200   -  Nov 13, 2009

John-Smith, Havent seen you Be for You knew or Old, or just not been on here?

 Respond  
JohnSmith   -  Nov 12, 2009

Looks good Gummo, long time no see. ''Rate it or Hate it?''. 8/10, i gotta jump on irc some time.

 Respond  
Cracker200   -  Nov 12, 2009

sexy.
LOL ^
And Nice Snippit, i find it useful =D

 Respond  
Ghost-writer   -  Nov 12, 2009

sexy.

 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.