mIRC Homepage
Posted By: Zelda4ever32 on sop - 01/06/04 09:03 PM
Hey everyone,

Since I am the only on here who seems to use networks with sops, i was wondering if someone could write me an on sop workaround. An on Raw would be great. laugh

Thanks

-Zelda4ever
aka "The Big 'Z'"
Posted By: milosh Re: on sop - 01/06/04 09:17 PM
Hi, there. I guess you mean channel sop. If my guess is good, then the only way mIRC can know if somebody is sop is:
1) on servers that support /mode #channel +a <user> : to check if user has +a mode, or to request sop channel list
2) on server that don't support +a or +q modes : to request sop channel list
So I don't see a way to script this, becouse, your script would have to check that channel list every time something (anything) happens.
You can, however, make on *:text: event example and then inside that event check if user has +a or to request sop list.

I hope I am right about this. :tongue:
Posted By: Zyzzyx26 Re: on sop - 01/06/04 09:23 PM
You could use on RAWMODE smile

/help on rawmode

Im not sure what character does your network use for SOPs (and not sure how to make that script), so its hard to one, but should be something like this:
Code:
on *:RAWMODE:#: {
 if ([color:red]+a[/color] isin $1-) { commands }
}


Hope this helps smile
Zyzzy.
Posted By: Naz Re: on sop - 02/06/04 02:56 AM
This will detect when you get moded +a (SOP/Founder) on networks that have this feature.
Code:
 
on *:rawmode:#: { 
  if (($1 == +a) &amp;&amp; ($2 == $me)) {
    commands here
  }
}
 
Posted By: starbucks_mafia Re: on sop - 02/06/04 12:29 PM
The other codes you've been given won't work if someone provides a mode change that involves more than just +a (ie. /mode #channel +ma nickname will break all of them). Here's a little bit of code to provide events for every mode change:

Code:
on ^*:rawmode:#:{
  ; Creates signals in the form mode&lt;sign&gt;&lt;modechar&gt;
  var %i = 1, %parm = 1, %sign
  while $mid($1, %i, 1) != $null {
    var %char = $ifmatch
    if (%char isin +-) %sign = %char
    else {
      if (%sign == + &amp;&amp; %char isin $gettok($chanmodes,1-3,44) $+ $nickmode) || (%sign == - &amp;&amp; %char isin $gettok($chanmodes,1-2,44) $+ $nickmode) {
        inc %parm
        .signal -n $+(mode, %sign, %char) # $nick $eval($ $+ %parm,2)
      }
      else .signal -n $+(mode, %sign, %char) # $nick
    }
    inc %i
  }
  ; Uncomment line below to hide default event
  ; haltdef
}



So to do something with +a/-a events, you would create two signals like this:
Code:
on *:signal:mode+a:{
  ; $1 is channel, $2 is nick, $3 is parameter
  [color:red]Your commands here for +a events[/color]
}

on *:signal:mode-a:{
  ; $1 is channel, $2 is nick, $3 is parameter
  [color:red]Your commands here for -a events[/color]
}
Posted By: Zelda4ever32 Re: on sop - 03/06/04 04:00 AM
Hey,

Cool, thanks for the help.

-Zelda4ever
aka "The Big 'Z'"
Posted By: Zyzzyx26 Re: on sop - 12/08/04 09:09 PM
May I ask why only the 3 first chanmodes?

$gettok($chanmodes,1-3,44)
Posted By: starbucks_mafia Re: on sop - 12/08/04 11:52 PM
It's the first 3 classes of chanmodes, as defined in the CHANMODES token of raw 005. There are 4 classes that the CHANMODES token defines, separated by a comma (ASCII character 44 - the delimiter I'm using in that $gettok() call). The first two classes take a parameter when they're set (+<mode>) and when they're unset (-<mode>), the third class only takes a parameter when being set, and the fourth class never takes a parameter. If you take a look at the entire line that the $gettok() is being used on, it's checking that if the sign is a plus then the character is in the first 3 classes, and if the sign is negative then it's checking if the character is in the first 2 classes. In other words that line is checking whether that particular mode takes a parameter.

Note: Take a look here for a more complete explanation of the CHANMODES token.
Posted By: Zyzzyx26 Re: on sop - 25/08/04 08:59 PM
I never got the reply message in my email, so I just saw the answer now. Thanks! smile
© mIRC Discussion Forums