mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 31
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jan 2003
Posts: 31
I have this code:

alias listops {
echo 4 * Listing Ops on #
set %i 1
:next
set %nick $nick(#,%i)
if %nick == $null goto done
if %nick ishop # echo 3 %nick is an HOp!
inc %i
goto next
:done
echo 4 * End of Ops list
}

And thats about as far as i am. I want to type /hopnotice <notice> and have it send a notice to all hop's on a channel? any ideas?

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Using /var and while loops, instead of /set and goto, is generally better
Code:
alias listops {
  echo 4 * Listing Ops on #
  var %i = 1
  while ($nick(#,%i,o)) {
    echo 3 # * $ifmatch is an Op!
    inc %i
  }
  var %i = 1
  while ($nick(#,%i,h)) {
    echo 3 # * $ifmatch is an HOp!
    inc %i
  }
  echo 4 * End of Ops list
}

Some networks may allow the use of "/notice %#channel message", similar to "/notice @#channel message", to send a notice to all ops or hops, but I don't really know so I won't use that. You could try it and see if it works though smile
/hopnotice <message>
Code:
alias hopnotice {
  var %i = 1
  while ($nick(#,%i,h)) {
    .notice $ifmatch $$1-
    inc %i
  }
  echo -at -&gt; $+(HOps:,#,:) $1-
}


Link Copied to Clipboard