ban all channels

By X1qu10n3r on Jul 12, 2007

To use, just type /banac the message is optional. It bans the user from the room, and if the user is in any other room that you have op in it will ban him and kick him with the message if you put one.

banac {
  if ($scid($activecid).status == disconnected) { echo -a Disconnected from active server | halt }
  echo -a Banning $1
  var %b 1
  while (%b <= $chan(0)) {
    var %c 1
    while (%c <= $nick($chan(%b),0)) {
      if ($nick($chan(%b),%c) == $1) && ($me isop $chan(%b)) {
        mode $chan(%b) +b $address($1,2) | kick $chan(%b) $1 $iif($2,$2-,Banned.) 
      }
      inc %c
    }
    inc %b
  }
} 

Comments

Sign in to comment.
X1qu10n3r   -  Jul 12, 2007

I just started scripting again after four months of stopping. So yea..

 Respond  
Lindrian   -  Jul 12, 2007

Here is a code that i made aswell, http://www.hawkee.com/snippet/2803/, doing the same thing as yours, but on all networks. A little more flexiblity on it, as you can ban several persons, you might learn something from it hehe :p.

And can\'t you just do if ($status == disconnected) { ?

 Respond  
Lindrian   -  Jul 12, 2007

use $comchan() instead of $chan(), as $chan() will return the channel name, if the channel window is active or not. AKA \"Keep channel windows open\",

 Respond  
xDaeMoN   -  Jul 12, 2007

You can use \"/ban -k ...\" instead of using 2 commands for the ban-kick ;)

 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.