Single line output mass modes

By ch1zra on Feb 03, 2005

Usage :
type in $chan window /mass with params, /mass +/-o or /mass +/-h or /mass +/-v or /mass +/-b. if no params are entered, you get echo that says that you must enter something.

why single line ?? because that way you cannot trigger mode flood prots
:)

; Single line output mass modes
; by ch1zra
; ch1zra@gmail.com
; http://uptheirons.co.sr/

alias mass {
  if ($me isop $chan) {
    var %num  = $nick(#,0)  
    ; getting the number of users on $chan
    var %i 1
    while (%i <= %num) {
      var %tmpnick  = $nick(#,%i)
      if (%tmpnick != $me) {
        var %tnk  %vnikz
        var %vnikz %tmpnick   %tnk
      }
      inc %i
    }
    if ($1 == $null) {  
      ; if no params are entered
      echo -a  $+ $color(info) $+ [Modes] You must enter which mode to be used. -[(supported +/- vohb)]-
    }
    if (+v isin $1-) {  
      ; giving mass voice
      mode # + $+ $str(v,$calc(%num - 1)) %vnikz
    }
    if (-v isin $1-) {  
      ; giving mass devoice
      mode # - $+ $str(v,$calc(%num - 1)) %vnikz
    }
    if (+o isin $1-) {  
      ; giving mass op
      mode # + $+ $str(o,$calc(%num - 1)) %vnikz
    }
    if (-o isin $1-) {  
      ; giving mass deop
      mode # - $+ $str(o,$calc(%num - 1)) %vnikz
    }
    if (+h isin $1-) {  
      ; giving mass hop
      mode # + $+ $str(h,$calc(%num - 1)) %vnikz
    }
    if (-h isin $1-) {  
      ; giving mass dehop
      mode # - $+ $str(h,$calc(%num - 1)) %vnikz
    }
    if (+b isin $1-) {  
      ; giving mass ban
      mode # + $+ $str(b,$calc(%num - 1)) %vnikz 
    }
    if (-b isin $1-) {  
      ; giving mass unban
      mode # - $+ $str(b,$calc(%num - 1)) %vnikz
    }
  }
}

Comments

Sign in to comment.
Yoinx   -  Feb 04, 2005

Well, from the looks of it, this script should work. However.... it should do exactly the same thing as xdaemon\'s here: http://hawkee.com/snippet.php?snippet_id=696 except that you dont string muliple mode changes, or mine here: http://hawkee.com/snippet.php?snippet_id=670 only difference is you\'d have to add a while loop to get all the nick in the chan to be affected and change the $snicks part... overall, I\'d say you should look into $modespl .... besides, you have it stringing the modes to a length equal to the number of people in a chan. so like xdaemon said. It wont do the whole chan, it should only do the first few (however many are in $modespl)

 Respond  
ch1zra   -  Feb 04, 2005

that could be done with $snicks, but this way you can massmode whole chan.

 Respond  
xDaeMoN   -  Feb 04, 2005

It would do a mass mode but on just a few users only or equal to the max mode the server allows which is most likely 6.

 Respond  
xDaeMoN   -  Feb 04, 2005

You could get rid those 30 lines & use \"mode # $+($left($1,1),$str($right($1,1),$calc(%num - 1))) %vnikz\" for setting modes & add a check to make sure \"+\" or \"-\" is in $1. That way your code wil be shorter. Also this would only do a mass mode once.

 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.