Nick Change/Quiet Ban

By Serpentsounds on Nov 28, 2009

I was just browsing through some old code I had today, and noticed an extended ban bit that appeared to be rather inefficient and redundant. I ended up redoing a lot of it, and was satisfied with the result enough to share it. As is, it's rather limited, as it only does nick changing bans and quiet bans, but you should be able to change it to do something else. Pretty short, so you might have to build off it to get use from it. Like it is, though:

Usage:
/nb Nick/Address Nick/Address Nick/Address etc - Bans nickname changes
/unnb Nick/Address Nick/Address Nick/Address etc - Unbans nickname changes
/qb Nick/Address Nick/Address Nick/Address etc - Quiet ban
/unqb Nick/Address Nick/Address Nick/Address etc - Un-quiet ban

If a nick is specified, it will see if the IAL has an address for it. If it does, it bans type 3, else it does nick!@ for the ban. You can specify as many nicks and addresses as you want, though if you go above like 100 it's possible you could flood out, depending on your client and network settings.

99% sure everything works correctly, but as always, I'm human, so feel free to yell at me if it borks.

Edit: Changed something right after posting, for readability, not functionality.

alias -l extban {
  var %x = 1,%addrs,%n
  while ($gettok($4-,%x,32)) {
    %n = $v1
    %addrs = $addtok(%addrs,$iif(*!*@* iswm %n,$+(~,$1,:,$v2),$iif($address(%n,3),$+(~,$1,:,$v1),$+(~,$1,:,%n,!*@*))),32)
    if ($numtok(%addrs,32) == $modespl) {
      mode $3 $+($2,$str(b,$v1)) %addrs
      %addrs = $null
    }
    inc %x
  }
  if (%addrs) mode $3 $+($2,$str(b,$numtok(%addrs,32))) %addrs
}

alias nb extban n + $chan $1- 
alias unnb extban n - $chan $1-
alias qb extban q + $chan $1-
alias unqb extban q - $chan $1-

Comments

Sign in to comment.
Cheiron   -  Nov 28, 2009

on the quiet ban ,.. that will only work if the user in question is unvoiced so you need to set a devoice there also

~q quiet People matching these bans can join but are unable to speak, unless they have +v or higher. Ex: ~q:!@blah.blah.com
~n nickchange People matching these bans cannot change nicks, unless they have +v or higher. Ex: ~n:!@*.aol.com

 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.