It will be hard to deop the same target, because some times +o is used and some times +oooooo is used! Then we would individually have to check for each list index if +ooo, or a greater one is used. If they exist and not are "" then the bot can deop them. But then we would have to recheck the channel list, if it is still greater, then deop more people, other
wise halt.
I modified it a little bit. Try this code. If still it seems to deop wrong people then, I guess that's your badluck, heh. It will make sure only 8 people are opped on the channel, and the ones coming in the channel even if they are extra ops doesnt mean they will be specifically deoped, the bot can deop any op, to make the channel it under the op limit.
Code: Select all
set checkchans "#yourchannel"
set maxops "8"
bind mode - "*+o*" check:ops
proc check:ops {nick uhost hand chan mode target} {
global botnick checkchans maxops
set totalops 0; set list [list]
if {($mode == "+o")} {
if {(([lsearch -exact [string tolower $checkchans] [string tolower $chan]] != -1) || ($checkchans == "*"))} {
foreach user [chanlist $chan] {
if {[isop $user $chan]} {
incr totalops; lappend list $user
}
}
if {($totalops > $maxops)} {
set deopnicks [lrange $list $maxops end]
if {([botisop $chan]) && ($deopnicks != "")} {
putserv "MODE $chan -oooooo [join $deopnicks]"
putserv "PRIVMSG $chan :$deopnick O Limit de Operadores no Canal e $maxops "; return 0
}
}
}
}
}
putlog "OpLimit by awyeah - LOADED"