View Single Post
Old 11-13-2003, 08:26 AM   #11 (permalink)
greffov
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
Ok, Dunce tempted me to improve this little script, here the results:

Code:
on 1:text:!massvoice:*: {
  ; find out if we are op and the user issuing the command is op too.
  ; If not, stop the script...
  if ($me !isop $chan || $nick !isop $chan) {
    msg $chan Either you ( $+ $nick $+ ) or me ain't op in $chan
    halt
  }

  ; iterate through all members in the chan
  var %i, %voicestr
  set %i 1
  ; we request only users which have no state (yet)
  while ($nick($chan, %i, a, voh)) {
    set %voicestr v $+ %voicestr $nick($chan, %i, a, voh)
    set %i $calc(%i + 1) 
  }
  mode $chan + $+ %voicestr
}

on 1:text:!massdevoice:*: {
  ; find out if we are op and the user issuing the command is op too.
  ; If not, stop the script...
  if ($me !isop $chan || $nick !isop $chan) {
    msg $chan Either you ( $+ $nick $+ ) or me ain't op in $chan
    halt
  }

  ; iterate through all members in the chan
  var %i, %voicestr
  set %i 1
  ; we request only users which have state v
  while ($nick($chan, %i, v)) {
    set %voicestr v $+ %voicestr $nick($chan, %i, v)
    set %i $calc(%i + 1) 
  }
  mode $chan - $+ %voicestr
}
Actual change: it now voices/devoices any one in one line, instead of multiple.
It also operates on the channel it is called in, for I saw no issue in giving the channel to operate on.
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote