mIRC Home    About    Download    Register    News    Help

Print Thread
#23170 08/05/03 10:19 AM
O
OpenSource
OpenSource
O
ON 1:Mode:#:{
if ($1 == -a) && ($nick == $me) { /msg chanserv protect # $me }
}
its not working any idea ? smirk smirk

T
theRat
theRat
T
The on MODE event triggers when a user changes a channel mode.
Channel modes are usually +nmtkispl

You're "protecting" yourself when you first deprotect yourself, what's the use of that?
Or are you trying to "protect" yourself if some1 "deprotects" you, for that you'd have to parse on rawmode event...
something along these lines
on *:rawmode:#: if (($1 == -a) && ($2 == $me)) { /msg chanserv protect # $me }

O
OpenSource
OpenSource
O
thx for fast help laugh wink :tongue:

P
pheonix
pheonix
P
i thought it was raw mode:*:{
and not on *:MODE:#:{

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
If you'd like a more precise way of accounting for a removal of protection, I made an alias to disassemble the mode changes mode by mode. All you do is on a mode change, take the modes and parameters after it and send them to the alias. The alias then returns it with mode:affected_param

Ex: If you had the follwoing mode change...
+o-b+b KingTomato KingTomato!*@* SomeLoser!Nick@host.com

And you sent that to the alias, it would return:
+o:KingTomato -b:KingTomato!*@* +b:SomeLose!!Nick@host.com

Then, you could do a check such as..
If ($istok($parsemodes($1-), $+(-a:,$me), 32)) {
/chanserv protect # $me
}

Basically, its looking for the -a (protect) and your name together, meaning the mode effected you. Anyways, here is the code, ejoy!

alias parsemodes {
/set -u0 %param 2
/set -u0 %m 1
while (%m <= $len($gettok($1, 1, 32))) {
/set -u0 %chr $mid($gettok($1, 1, 32), %m, 1)
if (%chr == +) || (%chr == -) { /set -u0 %mod %chr }
else {
if (%chr isincs behklov) {
/set -u0 %modes $addtok(%modes, $+(%mod,%chr,:,$gettok($1, %param, 32)), 32)
/inc -u0 %param
}
else { /set -u0 %modes $addtok(%modes, $+(%mod,%chr), 32) }
}
/inc -u0 %m
}
return %modes
}

C
codemastr
codemastr
C
Well thats a nice script, but it doesn't always work.

if (%chr isincs behklov) {

I'd change that to

if (%chr isincs $remove($gettok($chanmodes,1-3,44),$chr(44)) || %chr isincs qaohv) {

Thats still not perfect because mIRC doesn't give you the PREFIX= mode characters, but it is more accurate since it supports all parameterized modes in CHAMODES=.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Thank you codemastr-- I never though to query modes with paramets that way--good call.

Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
Thats still not perfect because mIRC doesn't give you the PREFIX= mode characters

It does, with $nickmode.

C
codemastr
codemastr
C
ah, indeed it does. $nickmode appears to be undocumented?

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
That's odd, I do $nickmode and i return ohv, yet my irc doesn't offer a half-op mode.. Wierd :tongue:

Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
Try $prefix ?

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
yet the same, @%+ and again, the network does not support half op

Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
Check the 005 numeric in your status window, does it send a PREFIX value?

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
005 KingTomato NOQUIT TOKEN WATCH=128 SAFELIST :are available on this server


Must be a mirc default >:\


Link Copied to Clipboard