mIRC Homepage
Posted By: crazy0ne on text that only applys to op's - 07/12/05 02:02 AM
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:

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

Posted By: ClickHeRe Re: on text that only applys to op's - 07/12/05 02:08 AM
on @*:text:...
Posted By: schaefer31 Re: on text that only applys to op's - 07/12/05 02:17 AM
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:

[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
Posted By: crazy0ne Re: on text that only applys to op's - 07/12/05 02:20 AM
works great, thanks.
© mIRC Discussion Forums