;This sets the nick to protect
alias bprotect {
;Popup box if you didn't specify a nick
if ($1 == $null) set %pnick $$?="Nick to protect:"
else set %pnick $1
echo -a Protected nick set to: %pnick
}
;Used to make the protected nick join automatically
alias bla { ctcp %pnick JOIN %ab }
;Turns protection on
alias protect.on { set %protect on }
;Turns protection off
alias protect.off { set %protect off }
;If the protected nick doesn't automatically regain his
;Ops because of him being kicked, it ops him.
on *:Join:#:{
;Routine checks
if ($nick == %pnick) && ($nick !isop $chan) && (%oponjoin == on) && ($me isop $chan) {
mode $chan +o %pnick
}
}
;Joins the channel again if you've been kicked
on ^*:CTCP:JOIN*:*:{
;Checks
if ($nick == %pnick) join $2
}
;Deop Protection
on *:Deop:#:{
if ($me isop $chan) && ($opnick == %pnick) && (%protect == on) {
;Deops nick that deopped protected nick
mode # -o $nick
;Kicks nick that deopped protected nick
kick $nick $chan Do not deop %pnick $+ !
;Ops protected nick again
mode # +o %pnick
}
}
;Kick protection
on *:Kick:#:{
set %ab $chan
;Checks
if ($me isop %ab) && ($opnick == %pnick) && (%protect == on) {
;Bans nick for 2 minutes
ban -ku120 %ab $nick 9 Do not kick %pnick $+ !
;Makes protected nick rejoin
bla
;Sets it so that when the protected nick rejoins they can be opped
set %oponjoin on
}
}
;Ban protection
on *:Ban:#:{
set %ab $chan
;Checks
if ($me isop %ab) && ($opnick == %pnick) && (%protect == on) {
;Bans nick for 10 minutes
ban -ku600 %ab $nick 9 Do not kick %pnick $+ !
;Unbans protected nick
mode %ab -b %pnick
;If nick was also kicked, invites nick back
if (%pnick !isin %ab) bla
;Sets it so that protected nick can be opped when he joins again
set %oponjoin on
}
}
;Menu options
menu * {
bot&user protection
.Set nick to protect: bprotect
.Turn On: protect.on
.Turn Off: protect.off
}
;
;Please report any bugs. There shouldn't be any, but you never know.
;