View Single Post
Old 11-13-2003, 04:55 AM   #10 (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
Quote:
Originally posted by Mick
ok, just an inside to my scripting history, ok i admit it, i have never seen while-loop i have only been scripting for a short time, still learning / teaching myself, thanks for the heads up, i will endeavour to read some books

I would appreciate seeing what you would have used, instead of the one i made, thanks in advance
It was not meant to criticize your way of doing it... I'm a starter also, and mIRC is driving me nuts on a regular base.

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

  ; iterate through all members in the chan
  var %i
  set %i 1
  ; we request only users which have no state (yet)
  while ($nick($2, %i, a, voh)) {
    mode $2 +v $nick($2, %i, a, voh)
    set %i $calc(%i + 1) 
  }
}
I tested this and it seems to work also! yay
I added this command to RaDiOBoT, thanks Mick!
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote