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
}
}