mIRC Home    About    Download    Register    News    Help

Print Thread
on text that only applys to op's #137031 07/12/05 02:02 AM
Joined: Dec 2005
Posts: 6
C
crazy0ne Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2005
Posts: 6
ok, well, I know pretty much the basics to make some simple scripts for irc, and, this script i want only open for ops to use, i have tried a few different things trying to make it for only ops, but none work. So, i have come to the experts for help :P

My script:

Code:
on *:text:!mute*:#:/mute $chan $2-
alias mute {
  if ($1 ischan) {

    mode # -hvo $$2 $$2 $$2 | /msg $$2 Take a few moments a chill the [censored] out... Thanks. $$2
  }
}  


Thanks.

Re: on text that only applys to op's #137032 07/12/05 02:08 AM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
on @*:text:...

Re: on text that only applys to op's #137033 07/12/05 02:17 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The @ prefix means it will trigger only if the person running the script is Opped. It doesn't mean that it only can be triggered by ops.

Personally, I don't see the purpose of using an alias. The check for ischan was unneeded, since the on text was always passing $chan (it's not possible for this to return a non-channel in the way it's being used). It's simpler to keep everything together like this:

Code:
[color:green]; Check if I am opped before proceeding[/color]
on @*:text:!mute *:#:{
  [color:green]; Check if triggered by an opped user and that mutenick is on the channel[/color]
  if ($nick isop # && $2 ison #) { 
    [color:green]; Rather than assume the mutenick has +ovh, we check them individually
    ; If the mutenick is voiced, devoice him[/color]
    if ($2 isvoice #) {
      mode # -v $2
    }
    [color:green]; If the mutenick is opped, deop him[/color]
    if ($2 isop #) {
      mode # -o $2
    }
    [color:green]; If the mutenick is halfopped, de-halfop him[/color]
    if ($2 ishop #) {
      mode # -h $2
    }
  }
}

Last edited by schaefer31; 07/12/05 02:27 AM.
Re: on text that only applys to op's #137034 07/12/05 02:20 AM
Joined: Dec 2005
Posts: 6
C
crazy0ne Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2005
Posts: 6
works great, thanks.