What It Does:
If someone bans you from a channel it removes the ban, then kick bans them for 5 minutes.
NEXT: The other one is for DeOperator protection. If you have SOP or AOP. For SOP if someone just takes off your +o, it will ban them from the channel for 30 minutes.
LAST: If someone takes away your owner (Or someone gains owner into your channel and takes it away, you will part the channel and then your variables %chan and %pw will identify to chanserv so that you will be identified as the owner of the channel. It will rejoin you then k/ban them out with two ban masks for 30 minutes. If you have any regards, comments, questions, feel free to email.
NOTE: With the Load command when you get the first popup you enter the channel. Second, the password for the variables of the DeOwner.
TO LOAD SCRIPT: In your mIRC Directory hit Alt+R then save this into your remotes, hit OK, and you're done. :]
on *:LoaD: {
set %chan $$?="Channel that maybe vulnerable to be taken over:"
set %pw $$?="Password to the channel"
}
on @*:BAN:#:{
if ($banmask iswm $address($me,2)) {
;; This verifies the address that the user bans you by
;; You can change it if you like
.mode $chan -b $banmask
msg $chan Now banishing $nick $+ ...
.ban -k 4 350 $chan $nick Banned!
}
}
on @*:DEOP:#: {
;; Using the @ can also verify if the user had & and their +o was taken away
;; So they could still k/ban
if ($deop iswm $me) {
.notice $nick Do not Deop me.
.ban -k $chan 1800 Bye.
}
}
on @*:DEOWNER:#: {
;; I also used the @ in this because when you're owner
;; You gain +o with it also, so if someone attempts
;; To somehow gain your channels password, and get Owner then take yours away
;; This code will enter the channels password and identify then rejoin
if ($deowner iswm $me) {
.part $chan
.msg ChanServ IDENTIFY %chan %pw
.timer 1 3 | join $chan
.notice $nick This is my channel, not yours.
.ban -k $chan 2 1800 | .ban -k 4 1800 My chan, make your own.
}
}
;END
here is my review :
the snippet has many bugs and no error checking .. first in the on :ban: section ,,, first u didnt check that the nick isnt urs .. in other words try to ban urself and u will get kicked so the ban have to be like
on @:BAN:#:{
if ($banmask iswm $address($me,2)) && ($nick != $me) {
.mode $chan -b $banmask
msg $chan Now banishing $nick $+ ...
.ban -k 4 350 $chan $nick Banned!
}
}
thats the first error...lets get to the point..in the on :op: its totally wrong to use $deop as i think it doesnt exist...the op/deop identifier is $opnick in addition to that u didnt add checking that ur not the one deopped urself...even u cant use ban on deop cz u didnt reop urself .. so it will be like
on @:DEOP:#: {
if ($opnick == $me) && ($nick != $me) {
hop $chan
.notice $nick Do not Deop me.
.ban -k $chan $nick Bye.
}
}
the last point and its the on *:DEOWNER: ... where did u know abt that event..??