This code is quite simple, use:
MV - Will voice the channel if is defined and you are a channel operator/half operator
MDV - Will Devoice the channel if is defined and you are a channel operator/half operator
This is probably not recommended for ircops who have mode override as this script checks for chanop status.
They are done as seperate aliases because i wanted it that way, if there is enough call for it i can do a Mass alias with +v and -v to decided the script, and i will add op/deop and hop/dehop later.
If you have not used my Mass Kick/Ban script or any other script that uses this $chm alias than copy as is otherwise remove the chm bit.
Tell me what you think. Cheers
##### Mass Mode Script by Freaky #####
alias chm {
var %status $left($nick($1,$2).pnick,1), %h $chr(37), %o $chr(64), %a $chr(38), %q $chr(126)
if $prop = hop { return $istok(%h %o %a %q,%status,32) }
if $prop = op { return $istok(%o %a %q,%status,32) }
if $prop = admin { return $istok(%a %q,%status,32) }
if $prop = owner { return $istok(%q,%status,32) }
}
alias MV {
if $1 {
if $chm($1,$me).hop {
var %y $+(+,$str(v,$modespl)), %x $nick($1,0,r)
while (%x) {
%mv = %mv $nick($1,%x)
if $numtok(%x,32) = $modespl { mode $1 %y %mv | unset %mv }
dec %x
}
mode $1 %y %mv
unset %mv
}
else { echo $me you need to be an op/halfop of $1 to use this command. }
}
else { echo $me please specify a channel. }
}
alias MDV {
if $1 {
if $chm($1,$me).hop {
var %y $+(-,$str(v,$modespl)), %x $nick($1,0,r)
while (%x) {
%mdv = %mdv $nick($1,%x)
if $numtok(%x,32) = $modespl { mode $1 %y %mdv | unset %mdv }
dec %x
}
mode $1 %y %mdv
unset %mdv
}
else { echo $me you need to be an op/halfop of $1 to use this command. }
}
else { echo $me please specify a channel. }
}
Nufsaid, use this one here:
alias m {
var %i 1,%p,%m $modespl,%mass, %mv $iif($$1 = v,+,$iif($$1 = dv,-))
%p = $+(%mv,$str(v,%m)) | while $nick(#,%i,a,oh&~) {
$iif($ifmatch != $me,%mass = %mass $ifmatch)
if ($token(%mass,0,32) = %m || $nick(#,0,a,oh&~) = %i) {
mode # %p %mass | %mass = ""
}
inc %i
}
}
The commands are:
/m v
to mass voice.
/m dv
to mass devoice
this is what i get when i try to use the devoice command--> * /set: line too long (line 30, Massive-DeVoive.txt)
and there over 200 people in there an about half stay voiced i need to devoice them to make sure there server is working the only way to get revoiced if there server runs and working properly any suggestions
so it effectively mass voice/devoices them allAre you sure?
I reloaded your original script and I had 7 unvoiced users in the channel, but it only voiced 6 of them. My network has a modespl of 6.
//echo -a $nick(#GoFish,0,r) returned 7 regular users
Then I did /mv #GoFish and only 6 users were voiced: > * noob sets mode: +vvvvvv triviabot snailbot Nickk Kirby2 GenghisKhan fishbot
if you look at the script carefully once the modespl gets full it voices them then refills the variable again.. so it effectively mass voice/devoices them all. and i will optimise the code a bit, the reason for the unsetting of %z is because once it getts full it needs to be cleared, i guess i can use the var command for this..
This is very neat, but this only voices up to the number returned in $modespl.
If the number of people in a channel exceeds it, then I think you should loop the mass-voicing or devoicing again, instead of spamming the command multiple times to meet your expectations.
I also suggest these few, minor changes that could help shorten your scripts - you can ignore me if you want, this isn't my snippet.
if $me isop $1 || $me ishop $1 {
can be written as
if ($nick($chan,$me,ho)) {
, ho, obviously standing for hop/op.
var %y $+(+,$str(v,$modespl))
var %x = $nick($1,0)
can also be written as
var %y $+(+,$str(v,$modespl)), %x $nick($1,0)
and finally, you don't need the
unset %z
because all of these /var's are local.
I'm rating 6 for the code right now, but I'll rate 7 if you get it to mass-voice or devoice ALL users, if possible. :)