mIRC Homepage

Deop Protection but me deop self

Posted By: MrPeepers

Deop Protection but me deop self - 18/08/03 06:40 AM

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?
Posted By: LocutusofBorg

Re: Deop Protection but me deop self - 18/08/03 07:19 AM

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
Posted By: Charlie

Re: Deop Protection but me deop self - 18/08/03 07:26 AM

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?>
    ...
  }
}
Posted By: KingTomato

Re: Deop Protection but me deop self - 18/08/03 07:37 AM

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?>
  ...
}
Posted By: Hammer

Re: Deop Protection but me deop self - 18/08/03 09:35 AM

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.
Posted By: MrPeepers

Re: Deop Protection but me deop self - 18/08/03 07:49 PM

I realize there isnt REAL protection I mearly used that as a figure of speech but thankyou for the help
Posted By: Zyzzyx26

Re: Deop Protection but me deop self - 25/04/04 11:10 PM

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.
© 2020 mIRC Discussion Forums