mIRC Home    About    Download    Register    News    Help

Print Thread
Deop Protection but me deop self #42684 18/08/03 06:40 AM
Joined: Aug 2003
Posts: 136
MrPeepers Offline OP
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.
Re: Deop Protection but me deop self #42685 18/08/03 07:19 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
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
Re: Deop Protection but me deop self #42686 18/08/03 07:26 AM
Joined: Dec 2002
Posts: 29
C
Charlie Offline
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
Re: Deop Protection but me deop self #42687 18/08/03 07:37 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
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
Re: Deop Protection but me deop self #42688 18/08/03 09:35 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
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
Re: Deop Protection but me deop self #42689 18/08/03 07:49 PM
Joined: Aug 2003
Posts: 136
MrPeepers Offline OP
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.
Re: Deop Protection but me deop self #42690 25/04/04 11:10 PM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
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