mIRC Home    About    Download    Register    News    Help

Print Thread
#23170 08/05/03 10:19 AM
Joined: May 2003
Posts: 2
O
Bowl of petunias
OP Offline
Bowl of petunias
O
Joined: May 2003
Posts: 2
ON 1:Mode:#:{
if ($1 == -a) && ($nick == $me) { /msg chanserv protect # $me }
}
its not working any idea ? smirk smirk

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
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 }


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: May 2003
Posts: 2
O
Bowl of petunias
OP Offline
Bowl of petunias
O
Joined: May 2003
Posts: 2
thx for fast help laugh wink :tongue:

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i thought it was raw mode:*:{
and not on *:MODE:#:{


new username: tidy_trax
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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
}


-KingTomato
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Thank you codemastr-- I never though to query modes with paramets that way--good call.


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

It does, with $nickmode.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
ah, indeed it does. $nickmode appears to be undocumented?

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


-KingTomato
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Try $prefix ?

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


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

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


Must be a mirc default >:\


-KingTomato

Link Copied to Clipboard