Deop, Dehalfop, Devoice Protection

By Cage on Apr 08, 2006

If the server you're on has a !deop command enabled (perhaps with BotServ) and you choose to deop yourself with that command, the script won't trigger. However, if another user deops, dehalfops, or devoices you in any channel you will execute the op command via chanserv for that channel.

on *:INPUT:#:{
  if (($1- == !deop) || ($1- == !dehalfop) || ($1- == !devoice)) {
    /set %dontdoit 1
    /timer25 1 10 /unset %dontdoit
  }
}
on *:DEOP:#: {
  if (%dontdoit == 1) { Halt }
  if ($nick == $me) { Halt }
  else if ($2 == $me) {
    msg chanserv op $chan $me
  }
}
on *:DEHELP:#: {
  if (%dontdoit == 1) { Halt }
  if ($nick == $me) { Halt }
  else if ($2 == $me) {
    msg chanserv halfop $chan $me
  }
}
on *:DEVOICE:#: {
  if (%dontdoit == 1) { Halt }
  if ($nick == $me) { Halt }
  else if ($2 == $me) {
    msg chanserv voice $chan $me
  }
}

Comments

Sign in to comment.
Cage   -  Jul 30, 2006

The on TEXT event doesn\'t trigger for anything except !deop, !dehalfop, and !devoice. The rest of the protection is triggered by the OP,HALFOP,VIOCE/DEOP,DEHALFOP,DEVOICE events. Therefore, using only an on TEXT even would serve no purpose...

 Respond  
sean   -  Apr 11, 2006

yeh, but the on text event would still catch it...

 Respond  
Cage   -  Apr 11, 2006

Because the op protection is triggered by deop, dehalfop, and devoice, not by text input.

 Respond  
sean   -  Apr 10, 2006

instead of having so many on events, why not simple if down to one text event:
on 1:TEXT:*:#: { if ($1 == !deop) && ($me isin $1-) { msg chanserv op $chan $me } if ($1 == !devoice) && ($me isin $1-) { msg chanserv voice $chan $me } }
and so on and so forth

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.