# Mass Modes

### By G13AoUsTiS on Mar 13, 2008

A Simple Mass Mode snippet
Usage:
/mass +|- o|v|b

``````alias mass {
if (\$regex(\$1-,/^[+|-][o|v|b]\$/)) {
var %a , %nicks
%a = 0
%nicks = \$null
:nextnick
inc %a
if (\$nick(#,%a) == \$null) { if (\$len(%nicks) > 0) .mode # \$mid(\$1,1,1) \$+ \$str(\$mid(\$1,2,2),\$gettok(%nicks,0,32)) %nicks  | halt }
%nicks = %nicks \$nick(#,%a)
if (6 // %a) { .mode # \$mid(\$1,1,1) \$+ \$str(\$mid(\$1,2,2),\$gettok(%nicks,0,32)) %nicks | %nicks = \$null }
goto nextnick
}
else {
echo -a Specify A Correct Mode: [+|-] [o|v|b]
}
}
``````

napa182   -  Apr 12, 2010

Xpl0reR Said:

napa your code is wrong, it gave +v only to people who are +o and when i used /mass -v it only removed the +v to the people who are +o
Fix IT :)

lol i posted that example 2 years ago ffs... you should know how to make one ur self by now.

Jethro   -  Apr 12, 2010

There's nothing wrong with napa's example. But it doesn't include a check for whether those who're given user modes or not.

You can use this one if you wish:

``````alias mass {
if (\$me isop #) {
var %i 1,%p,%m \$modespl,%mass
if ((\$\$1 = +o) && (!\$nick(#,0,o))) %p = \$+(+,\$str(o,%m))
elseif ((\$\$1 = -o) && (\$nick(#,0,o))) %p = \$+(-,\$str(o,%m))
elseif ((\$\$1 = +v) && (!\$nick(#,0,h))) %p = \$+(+,\$str(v,%m))
elseif ((\$\$1 = -v) && (\$nick(#,0,v))) %p = \$+(-,\$str(v,%m))
while \$nick(#,%i) { if (\$v1 != \$me) { %mass = %mass \$v1 }
if (\$gettok(%mass,0,32) = %m) || (\$nick(#,0) = %i) {
mode # %p %mass | %mass = "" } | inc %i } }
else { echo -a *** You're not opped in # *** }
}
``````

You can add more modes with another elseif in the same format shown.

xplo   -  Apr 12, 2010

napa your code is wrong, it gave +v only to people who are +o and when i used /mass -v it only removed the +v to the people who are +o
Fix IT :)

x1L22   -  Oct 18, 2009

+a +q +h ?

TwistedHumor   -  Dec 16, 2008

If your on a server that allows 12 modes at once, how do you mass the rest if you have like 37 people?

-  Apr 06, 2008

dude.... exempt yourself from the mass modes ......

-  Mar 27, 2008

Great coding, i love it :)

Lindrian   -  Mar 14, 2008

How about checking \$modespl? and napa,
%m \$remtok(%m,\$me,32)
u could do
if (\$nick(\$chan,%o) != \$me) var %m = \$addtok(%m,\$v1,32)

or so.

napa182   -  Mar 14, 2008

napa %a is set to 0 so while will not work. think
um yes you can use a while loop. this should do the same thing as ur\'s.

``````alias mass {
if (\$me isop #) && (\$regex(\$1-,/^[+-][ovb]\$/)) {
var %a = \$nick(\$chan,0), %o = 1
while (%o <= %a) {
inc %o
}
mode \$chan \$left(\$1,1) \$+ \$str(\$right(\$1,1),%o) %m
}
}
``````
xDaeMoN   -  Mar 14, 2008

Set %a to 1 then in the while loop ;)

G13AoUsTiS   -  Mar 14, 2008

Lindrian Thanks!
napa %a is set to 0 so while will not work. think

EL   -  Mar 13, 2008

Napa post your version man? Show him by example.`-.-

napa182   -  Mar 13, 2008

why not use a while loop instead of goto\'s? Also when you do the mass modes you mode and unmode ur\'self as well as the ban you may want to add a check to take ur\'self out of the mix. As well as a check if you are +o\'ed or not.

Lindrian   -  Mar 13, 2008
``````/^[+|-][o|v|b]\$/
``````

the | (pipes) will be treated as a character, so use this instead:

``````/^[+-][ovb]\$/
``````
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.