mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 136
Vogon poet
OP Offline
Vogon poet
Joined: Aug 2003
Posts: 136
I wrote a lil code for deop protection
on 1:DEOP:#: {
if ($nick == YourNick) { halt }
else { msg chanserv devoice $chan $nick | msg chanserv ban $chan $nick | msg chanserv kick $chan $nick Don't deop me. | msg chanserv deop $chan $nick | chanserv op $chan $me }
}
How could i alter it so it wouldnt attack me when I deop myself?


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
First off, protection implies PREVENTING something, not acting on it. That said, I'm wondering why you didn't read the helpfile when encountering this problem. Had you done so, you would have noticed two things:

1. in any event, $nick is ALWAYS the user triggering the event. now the one triggering the on DEOP event, is the one on the active side of it, not the receiving side.

2. according to the helpfile, (and I quote) "$opnick refers to the nickname of the person being opped/deopped".

3. did you ever consider the possibility whoever is deopping you might have a very valid reason for doing so? gonna get real popular this way frown


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Dec 2002
Posts: 29
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 29
you can use the event prefixes ! to prevent yourself triggering the remote event

Code:
on !*:deop:#: {
  ...
  <your code here>
  ...
}


or use this one ...

Code:
on *:deop:#: {
  if ($nick == $me) { halt }
  else {
    ...
    <what else?>
    ...
  }
}


Charlie
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
why do you insist on an uneccisery line of code?

Code:
if ($nick == $me) { halt }
else {
  ...
  <what else?>
  ...
}


is this, but easier

Code:
if ($nick != $me) {
  ...
  <what else?>
  ...
}


-KingTomato
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
His first example would be best as it prevents the entire event from firing in the first place.
Code:

on !*:DEOP:#:{ commandset }

or have 2 events if you have commands you wish to execute for both.
Code:

on me:@*:DEOP:#:{ commandset 1 }
on !*:DEOP:#:{ commandset 2 }

You could also halt your own deops in one channel alone and process them as normal in other channels.
Code:

on me:@*:DEOP:#channel1,#channel2,#channel3: halt
on *:DEOP:#:{ commandset }

In any case, these are all reactive events, not proactive protection. There is no such thing as protection from these kinds of events; only prevention and reaction.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Aug 2003
Posts: 136
Vogon poet
OP Offline
Vogon poet
Joined: Aug 2003
Posts: 136
I realize there isnt REAL protection I mearly used that as a figure of speech but thankyou for the help


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Im trying to make a very simple deop protection to put in my bot. It goes like this:
Code:
on @+1000:DEOP:#: mode $chan +o $opnick


But it doesnt seem to work smirk I tried echoing $opnick and $nick and it DIDN'T echo'd them!

Code:
on @+1000:DEOP:#: {
   echo -s * $opnick = opnick & $nick = nick
   mode $chan +o $opnick
}


Userlist levels are correctly set.

Pls help! smile

Thanks, Zyzzy.

Last edited by Zyzzyx26; 25/04/04 11:33 PM.

"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard