To popups:
Code:
Op: massmode # + o $$1 $2-
DeOp: massmode # - o $$1 $2-
Voice: massmode # + v $$1 $2-
DeVoice: massmode # - v $$1 $2-
 


To aliases:
Code:
massmode {
  if ( $me isop $1 ) {
    var %i = 4
    while ( [ [ $+($,%i) ] ] ) { 
      mode $1 $+($2,$str($3,$modespl)) [ [ $+($,%i,-,$calc( %i - 1 + $modespl )) ] ]
      inc %i $modespl
    }
  }
}
 


should work... (made it a bit simpler than the one I use, which works)