Mass Voice/ Mass Devoice

By freaky on Feb 26, 2009

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

Comments

Sign in to comment.
Jethro   -  Aug 13, 2011

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

 Respond  
Nufsaid   -  Aug 12, 2011

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

 Respond  
seaser   -  Aug 10, 2010

hoe do i use this? sry im new to it ...

 Respond  
freaky   -  Feb 26, 2009

Ok i will update the script using a way i use to determine chanops and admins.but as to why the last person is left off, i cannot seem to work it out, maybe because it is late but anyway any solution somebody can offer to fix this i would be more than happy editing the script.

Cheers

 Respond  
freaky   -  Feb 26, 2009

hmm, in theory it should have worked, i was not able to test it my self, i will find the solution.

 Respond  
Kirby   -  Feb 26, 2009

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

 Respond  
freaky   -  Feb 26, 2009

Ok i have updated the script, please test it out to make sure that i have not overlooked anything.

 Respond  
freaky   -  Feb 26, 2009

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

 Respond  
Kirby   -  Feb 26, 2009

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. :)

 Respond  
Aucun50   -  Feb 26, 2009

Looks handy

 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.