just load into ur remotes..then in a channel type /mass +o/-o or +v/-v
;Mass commands
;Use /mass +o/-o +v/-v ...
alias mass {
if ($me !isop #) {
echo -a Error : You are not op on $chan
}
else {
if ($regex($1,/\Q+v\E/i) == 1) {
echo -a +V
var %x 1
while %x <= $nick(#,0,r) {
set %x.nick %x.nick $nick(#,%x,r)
if $numtok(%x.nick,32) == $modespl { mode # + $+ $str(v,$modespl) %x.nick | unset %x.nick }
inc %x
}
if %x.nick { mode # + $+ $str(v,$modespl) %x.nick | unset %x.nick }
}
if ($regex($1,/\Q-v\E/i)) {
var %x 1
while %x <= $nick(#,0,v) {
set %x.nick %x.nick $nick(#,%x,v)
if $numtok(%x.nick,32) == $modespl { mode # - $+ $str(v,$modespl) %x.nick | unset %x.nick }
inc %x
}
if %x.nick { mode # - $+ $str(v,$modespl) %x.nick | unset %x.nick }
}
if ($regex($1,/\Q+o\E/i) == 1) {
var %x 1
while %x <= $nick(#,%x,a) {
set %x.nick %x.nick $nick(#,%x,a)
if $numtok(%x.nick,32) == $modespl { mode # + $+ $str(o,$modespl) %x.nick | unset %x.nick }
inc %x
}
if %x.nick { mode # + $+ $str(o,$modespl) %x.nick | unset %x.nick }
}
if ($regex($1,/\Q-o\E/i) == 1) {
var %x 1
while %x <= $nick(#,%x,o) {
set %x.nick %x.nick $remove($nick(#,%x,o),$me)
if $numtok(%x.nick,32) == $modespl { mode # - $+ $str(o,$modespl) %x.nick | unset %x.nick }
inc %x
}
if %x.nick { mode # - $+ $str(o,$modespl) %x.nick | unset %x.nick }
}
}
}
yeah I know gex, like I said, I missed that if after the while on my first post.
The code he has would work, I just posted the other one, to show a more efficent way of doing it since he is using regex. The code as he has it now, you\'d have to add another whole if section if you wanted to add another mode, with the example i gave you would merely add it to
if ($regex(mode,$1,/^(\+|-)(v|h|o)/i)) {
the (v|h|o) section in that if, and the code would use it. Like I said, Its just a slightly more efficient way of doing it in my opinion. In case you want to add more modes.
here\'s another way to do this, which is a little more efficent since you\'re using regex anyway.
alias mass {
if ($active !ischan) || ($me !isop $active) {
echo -a Error: This command can only be used on a channel which you have Op status in.
return
}
if ($regex(mode,$1,/^(\+|-)(v|h|o)/i)) {
if ($regml(mode,1) == + ) var %include = $remove(ohvr,$regml(mode,2))
elseif ($regml(mode,1) == - ) var %include = $regml(mode,2)
var %nicktotal = $nick($chan,0,%include)
while (%nicktotal) {
set %nicks $+(%nicks,$chr(32),$nick($chan,%nicktotal,%include))
if ($numtok(%nicks,32) == $modespl) {
mode $chan $str($+($regml(mode,1),$regml(mode,2)),$modespl) %nicks
unset %nicks
}
dec %nicktotal
}
if (%nicks) {
mode $chan $str($+($regml(mode,1),$regml(mode,2)),$numtok(%nicks,32)) %nicks
unset %nicks
}
}
}
it looks like you\'re only gonna do the mode changes on groups of people that meet modespl.
ie $modespl = 6, if you have 29 people in your room, you\'re only going to do the modechanges on the first 24. and it will skip the last 5 since they dont make it into the modespl multiple. and the while loop is broken out of without doing the modechange on them.
like I said though, I didnt test it, but thats how it looks.