Nicklist 'Mass' Menu

By Gummo on Sep 07, 2007

This is the 'mass' nicklist menu I use. It has mass user modes, mutes, kicks and bot user modes (bot voices, etc) - the bot modes use chanserv, so you'll need permanent access on a channel to use those ones (and a server with chanserv).

I've re-written it (and tested, fixing a bug) today so it's neater, easier to modify and more versatile, in that you can now use the aliases for the menu outside of the menu.

If you wish to use an alias here or modify anything to go into your script, I would appreciate some credit. :)

Put in remotes (File->New).

Update1: Fixed a bug. Update2: Updated by combining the aliases for channel modes and those with chanserv, also /qban and /qunban are now /qban (the aliases are smaller). /qban also now uses a different method for adding the ~q: prefix. Update3: Designed smaller regex in /qban. :) Update4: Fixed bug with w regex. (Changed to S to pick up obscure nicknames.) Update5: Fixed that bug the site keeps making.. It removes the backslashes. :(

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                          ;;
;;          NICKLIST: 'MASS' MENU           ;;
;;                BY GUMMO                  ;;
;;                                          ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

menu nicklist {
  -
  Mass
  .Voice: mmode chan +v $1-
  .Devoice: mmode chan -v $1-
  .Halfop: mmode chan +h $1-
  .Dehalfop: mmode chan -h $1-
  .Op: mmode chan +o $1-
  .Deop: mmode chan -o $1-
  .Protect: mmode chan +a $1-
  .Deprotect: mmode chan -a $1-
  .Owner: mmode chan +q $1-
  .Deowner: mmode chan -q $1-
  .-
  .Mass Kick: mkick $1-
  .-
  .Mute NICKs: qban +nick $1-
  .Unmute NICKs: qban -nick $1-
  .-
  .Mute IPs: qban +ip $1-
  .Unmute IPs: qban -ip $1-
  .-
  .Chanserv
  ..Voice: mmode bot +v $1-
  ..Devoice: mmode bot -v $1-
  ..Halfop: mmode bot +h $1-
  ..Dehalfop: mmode bot -h $1-
  ..Op: mmode bot +o $1-
  ..Deop: mmode bot -o $1-
  ..Protect: mmode bot +a $1-
  ..Deprotect: mmode bot -a $1-
  ..Owner: mmode bot +q $1-
  ..Deowner: mmode bot -q $1-
}

; MASS MUTE/UNMUTE
alias qban {
  if ($regex(qban1,$1-,[-+](nick|ip) \S+)) {
    while ($2) {
      if ($regex(qban2,$1,[-+]nick)) var %mute %mute $2 $+ !*@*
      elseif ($regex(qban2,$1,[-+]ip)) {
        if ($ial($2)) var %mute %mute $address($2,2)
        else echo 4 -a ERROR: No address for $2 $+ . Please type //who $ $+ chan and try again if you wish to mute this user.
      }
      tokenize 32 $1 $3-
    }
    var %a $left($1,1)
    tokenize 32 $regsubex(qban3,%mute,/(\s|^)/g,\1~q:)
    while ($0) {
      mode $chan %a $+ $str(b,$modespl) $1- [ $+ [ $modespl ] ]
      tokenize 32 $ [ $+ [ $calc($modespl + 1) ] $+ ] -
    }
  }
  else echo 14 -a  * /qban: insufficient parameters. /qban <nick/ip> <nick1> <nick2> ... <nickN>
}

; MASS MODES BOTH IN CHANNEL AND WITH CHANSERV
alias mmode {
  if ($regex(mmode,$1-,(chan|bot) [-+][vhoaq] \S+)) {
    tokenize 32 $1-
    while ($3) {
      if ($1 == chan) {
        mode $chan $left($2,1) $+ $str($right($2,1),$modespl) $3- [ $+ [ $calc($modespl + 3) ] ]
        tokenize 32 $1-2 $ [ $+ [ $calc($modespl + 4) ] $+ ] -
      }
      if ($1 == bot) {
        raw -q privmsg chanserv $replacex($2,+,,-,de,v,voice,h,halfop,o,op,a,protect,q,owner) $chan $3
        tokenize 32 $1-2 $4-
      }
    }
  }
  else echo 14 -a  * /mmode: insufficient parameters. /mmodeb <chan/bot> <+/-><v/h/o/a/q> <nick1> <nick2> ... <nickN>
}

; KICK ALL SELECTED NICKS FROM CHANNEL
alias mkick {
  if ($1) {
    var %msg $$?="Please enter a kick message:"
    while ($0) {
      kick $chan $1 %msg
      tokenize 32 $2-
    }
  }
  else echo 14 -a  * /mkick: insufficient parameters. /mkick <nick1> <nick2> ... <nickN>
}

; BAN ALL SELECTED NICKS FROM CHANNEL
alias mbkick {
  if ($2) && ($istok(nick ip,$1,32)) {
    var %msg $$?="Please enter a kick message:"
    while ($0) {
      kick $chan $1 %msg
      tokenize 32 $2-
    }
  }
  else echo 14 -a  * /mbkick: insufficient parameters. /mbkick <nick/ip> <nick1> <nick2> ... <nickN>
}

Comments

Sign in to comment.
Gummo   -  Oct 20, 2010

Mass ban would just be abused.

More
 Respond  
DevAkim   -  Oct 19, 2010

Very useful, but you should add Mass Ban along with Mass Kick. 9/10.

More
 Respond  
Bullet_Dodger   -  Oct 27, 2008

8/10 Very UseFull

More
 Respond  
Gummo   -  Oct 13, 2007

Updated again: Fixed bug with \w regex. (Changed to \S to pick up obscure nicknames.) :)

More
 Respond  
Gummo   -  Sep 11, 2007

Updated. :)

More
 Respond  
Gummo   -  Sep 07, 2007

For what you said first, it does that in the main section. The modes with the bot aren\'t terribly useful, but I use them enough to make it part of my menu. You can remove them if you like. Either way, I\'ve added the un-mute function. :)

More
 Respond  
mountaindew   -  Sep 07, 2007

and when you do mass mute/mass mute ip, you should have a way to like undo it or reset all mutes

More
 Respond  
mountaindew   -  Sep 07, 2007

then why not just do mode $chan +v $1

More
 Respond  
Gummo   -  Sep 07, 2007

The bot voices, etc. :\

More
 Respond  
mountaindew   -  Sep 07, 2007

now what is modes with bot?

More
 Respond  
Gummo   -  Sep 07, 2007

Done.

More
 Respond  
mountaindew   -  Sep 07, 2007

you should mention that part of it is for chanserv

More
 Respond  
Gummo   -  Sep 07, 2007

Sorry.. Forgot to delete that part. Updated.

More
 Respond  
mountaindew   -  Sep 07, 2007
  ;;;; ADDED FOR THE SAKE OF THE MENU ONLY
  ;;;; ADDED FOR THE SAKE OF THE MENU ONLY
  ;;;; ADDED FOR THE SAKE OF THE MENU ONLY
  ;;;; ADDED FOR THE SAKE OF THE MENU ONLY

whats up with that?

More
 Respond  
Gummo   -  Sep 07, 2007

Update: Forgot to put in $chan and managed to miss this somehow during testing.. o.o

More
 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.