Yet another mass voice

By Shinu on Apr 10, 2009

Just a simple mass voice with explanation.

alias mv {
  ; Was told to add this because some people might not know you need +o||+h to +v people.
  if (!$nick(#,$me,ho)) {
    echo -at *** You need to be either +o or +h in # to use /mv
  }
  else {
    ; Record total users
    var %a $nick(#,0)
    ; Loop through all users
    while (%a) {
      ; If the user isn't voice, add them to the list of users to be voiced
      if ($nick(#,%a) !isvoice #) var %b %b $nick(#,%a)
      ; Once the max users we can voice @ one time has been reached, send out the mode command and unvar the 'to-voice' list
      if ($numtok(%b,32) == $modespl) { mode # $+(+,$str(v,$modespl)) %b | var %b $null }
      ; Prepare to check the next user
      dec %a
    }
    ; While loop has ended, push out any remaining users in our 'to-voice' list. (if any)
    if (%b) mode # $+(+,$str(v,$numtok(%b,32))) %b
  }
}

Comments

Sign in to comment.
chachin   -  May 11, 2011

man this thing is awsome i did it in a channel with 343 people and it did it in like 3 seconds :D

 Respond  
Vegitha   -  May 01, 2011

awesome, this script works :)

 Respond  
bigrat2   -  Apr 18, 2009

Why just limit it to mass voice? Add functionality by making it do other modes too :)

 Respond  
Kirby   -  Apr 11, 2009

/me gives up.

 Respond  
Prelude   -  Apr 11, 2009

wth nvm i forget wtf i was gunna say after editing...

Oh nvm i remember , yeah why the hell would anyone tink that EVERYONE in the channel would get +v? makes zero sense, it should be obvisou its only those with no modes....

 Respond  
Kirby   -  Apr 11, 2009

it's a bit pointless to voice someone that has mode +o, +h, +a, or +q.Yeah it is, but then it wouldn't fit the original purpose, "mass-voice". Unless, "mass-voice" is interpreted as "voicing many regulars who don't have voice". If so, the parameter 'r' is fine.

 Respond  
napa182   -  Apr 11, 2009

? why ?
it's a bit pointless to voice someone that has mode +o, +h, +a, or +q.

 Respond  
Blitzjager   -  Apr 11, 2009

I'd go with ,a,v.

 Respond  
Kirby   -  Apr 11, 2009

I guess you are right..but how I interpreted "mass-voice" was voicing everyone in the channel including operators and above, besides the ones already are voiced. Logically speaking, I guess my theory makes no sense...

 Respond  
napa182   -  Apr 11, 2009

why would you want to voice users with a higher lvl? Only people that should need a voice is users with no mode hence r

 Respond  
Kirby   -  Apr 11, 2009

However napa, having levels above voice (operator, etc.) does not necessarily mean that you have voice. Though it works, it may not always be true.

 Respond  
Aucun50   -  Apr 11, 2009

For once i get what napa did somewhat, looks nice and has descriptions.

 Respond  
napa182   -  Apr 11, 2009

on

if ($nick(#,%a) !isvoice #) var %b %b $nick(#,%a)

you can make it

if ($nick(#,%a,r)) var %b %b $v1
 Respond  
Shinu   -  Apr 10, 2009

Exactly. :D

 Respond  
Kirby   -  Apr 10, 2009

You took Snippet #6000. :p

 Respond  
Shinu   -  Apr 10, 2009

Updated ;)

Thanks for the compliments :)

 Respond  
Kirby   -  Apr 10, 2009

Hi Shinu.

$gettok(%b,0,32)

is the same thing as

$numtok(%b,32)

Good code. Nice to see explanations to scripts => user friendly. :)

 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.