like this:
And here is my code :> and there are no known errors (i think)Test1 sets mode: +i
Bot make nothing
Test2 sets mode: +k dd
Bot make nothing
Test3 sets mode: +l 1
Bot make nothing
Code: Select all
bind pub - * mode:protection
proc mode:protection {nick host hand chan mode victim} {
channel set $chan [expr [channel get $chan id] + 1]
set service "[request:service $chan]"
set id "[channel get $chan id]"
if {($mode == "-o")&&($victim == "$::botnick")} {
if {[onchan "$service" $chan]} {
putquick "privmsg $service :op $chan"
}
if {($nick == "$service") && ($mode == "+i") || ($mode == "+s")} {
putserv "privmsg $service :CLEARINVITE $chan"
return 0
}
if {"$nick" == "$service"} {
return 0
}
if {"$nick" == "$::botnick"} {
return 0
}
if {![string match "*users.quakenet.org" "$host"]} {
set host [maskhost [getchanhost $nick $chan]]
} else {
set host "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
}
if {"$victim" == "$::botnick"} {
newchanban $chan $host $::botnick "You are not allowed to deop me in $chan! \((\ $id )" "30" "sticky"
putserv "kick $chan $nick :You are not allowed to deop me in $chan! \((\ $id )"
}
if {![matchattr $hand mno|mno $chan]} {
newchanban $chan $host "$::botnick" "You are not allowed to deop in $chan! \((\ $id )" "30" "sticky"
putserv "kick $chan $nick :You are not allowed to deop in $chan! \((\ $id )"
}
if {[channel get $chan rflag]} {
putserv "privmsg $service :chanlev $chan $nick -ao"
}
} elseif {("$mode" == "+o")} {
if {"$nick" == "$::botnick"} {
return 0
} elseif {"$nick" == "$service"} {
return 0
} elseif {[string match "*.quakenet.org" $host]} {
return 0
}
if {![string match "*users.quakenet.org" "$host"]} {
set host [maskhost [getchanhost $nick $chan]]
} else {
set host "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
}
newchanban $chan $host "$::botnick" "You are not allowed to op in $chan \((\ $id )" "30" "sticky"
putserv "kick $chan $nick :You are not allowed to op in $chan! \((\ $id )"
} elseif {("$mode" == "+b")} {
if {"$nick" == "$::botnick"} {
return 0
}
if {![string match "*users.quakenet.org" "$host"]} {
set host [maskhost [getchanhost $nick $chan]]
} else {
set host "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
}
set bothost "[getchanhost $::botnick $chan]"
if {![string match "$victim" "$bothost"]} {
if {![matchattr $hand mno|mn $chan]} {
newchanban $chan $host "$::botnick" "You are not allowed to ban me in $chan! \((\ $id )" "30" "sticky"
putserv "kick $chan $nick :You are not allowed to ban me in $chan! \((\ $id )"
foreach user [chanlist $chan] {
set hosts [getchanhost $user $chan]
if {[string match "$victim" "$hosts"]} {
newchanban $chan $host "$::botnick" "You are not allowed to ban in $chan! \((\ $id )" "30" "sticky"
putserv "kick $chan $nick :You are not allowed to ban in $chan! (( $id )"
putserv "mode $chan -b $victim"
} elseif {("$mode" == "+i")} {
if {![matchattr $hand mno|mn $chan]} {
if {![string match "*users.quakenet.org" "$host"]} {
set host [maskhost [getchanhost $nick $chan]]
} else {
set host "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
}
newchanban $chan $host $::botnick "You are not allowed to set invite only on $chan! (( $id )" 30 sticky
putserv "kick $chan $nick :You are not allowed to set invite only on $chan! \((\ $id )"
pushmode $chan -i
}
} elseif {("$mode" == "+l")} {
if {![matchattr $hand mno|mn $chan]} {
if {"$victim" <= "[llength [chanlist $chan]]"} {
if {![string match "*users.quakenet.org" "$host"]} {
set host [maskhost [getchanhost $nick $chan]]
} else {
set host "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
}
newchanban $chan $host $::botnick "You are not allowed to set a small limit in $chan! (( $id )" 30 sticky
putserv "kick $chan $nick :You are not allowed to set a small limit in $chan! \((\ $id )" 30 sticky
pushmode $chan -l
}
}
}
}
}
}
}
}