here are 2 different methods for doing it .. i couldnt deside which i liked best ...

Code:
massmode {
  ; * Usage: /massmode +/-ov [#chan]
  tokenize 32 $1 $iif($2 ischan, $2, $active)
  var %s = $iif($left($1,1) == +,1), %m = $right($1,-1)
  var %len = %modespl, %nicklist, %nick
  var %ctr = 0, %tot = $iif(%s, $nick($2,0,a,%m), $nick($2,0,%m))
  while (%ctr < %tot) {
    inc %ctr | var %nick = $iif(%s, $nick($2,%ctr,a,%m), $nick($2,%ctr,%m))
    %nicklist = %nicklist %nick
    if ($numtok(%nicklist,32) = %len) {
      mode $2 $+($iif(%s,+,-),$str(%m,%len)) %nicklist
      var %nicklist
    }
  }
  if (%nicklist) { mode $2 $+($iif(%s,+,-),$str(%m,$numtok(%nicklist,32))) %nicklist }
}

massmode2 {
  ; * Usage: /massmode +/-ov [#chan]
  tokenize 32 $1 $iif($2 ischan, $2, $active)
  var %s = $iif($left($1,1) == +,1), %m = $right($1,-1)
  var %len = $modespl, %nicklist, %nick
  var %ctr = 0, %tot = $iif(%s, $nick($2,0,a,%m), $nick($2,0,%m))
  while (%ctr < %tot) {
    inc %ctr | var %nick = $iif(%s, $nick($2,%ctr,a,%m), $nick($2,%ctr,%m))
    var %nicklist = %nicklist %nick
  }
  var %ctr = 1, %tot = $numtok(%nicklist,32)
  while (%ctr <= %tot) {
    var %range = $+(%ctr,-,$calc(%ctr * %len)) | inc %ctr %len
    mode $2 $+($iif(%s,+,-),$str(%m,%len)) $gettok(%nicklist,%range,32)
  }
}


basicly it loops though each person that doesnt match your desired outcome .. so if your doing /massmode +o for example
it will loop though $nick(#chan,N,a,o) (all nicks except ops)
all non ops in other words

but if your doing say -v
it loops though $nick(#chan,N,v) (all voices)

trather than looping though EVERYONE if they need it or not. (this will help prevent flood offs

notice that i use $modespl for %len (the length for each mode command) .. $modespl returns the limit the server alows for mode commands if specified in raw 005, however for some odd reason if u wish to change it u can simply replace $modespl with 6 .. or 4 .. or whatever u wish.

the difference between the first one and the 2nd one is that the first one sets the modes as it gets enough nicks to do so, while its still collecting nicks .. the 2nd one simply collects all nicks, then loops though and sets all modes .. it realy doesnt mater which u use.

if u have any questions about this code feel free to ask.

it should work with any +/-o,v,h,u (not all networks suport +h and +u)

Cobra^