This seems a little tricky to do.
You can use XTRA fields, and store yur number, then do checking that way, however, it's another set of permissions to monitor. What if you drop a master down to voice, but foeget the permissions. Bad move.
You can tyr this, though there is certainly no gurentee it will work. You pass it the handle of the person attmepting the kick (available from the arguemnts passed), the vistims handle (Use hand2nick) and the channel this is happening on. I did it this way, because I can't be bothered with conversions myself.
Code: Select all
proc checklevel {hand victim chan} {
if {($hand == "*") && ($victim == "*")} { return 0 }
if {($hand == "*") && ($victim != "*")} { return -1 }
if {($hand != "*") && ($victim == "*")} { return 1 }
set v "0"
set h "0"
if {[matchattr $victim "n"]} { incr v 20000 }
if {[matchattr $victim "|n" $chan]} { incr v 10000 }
if {[matchattr $victm "m"]} { incr v 2000 }
if {[matchattr $victim "|m" $chan]} { incr v 1000}
if {[matchattr $victim "o"]} { incr v 200 }
if {[matchattr $victim "|o" $chan]} { incr v 100 }
if {[matchattr $victim "v"]} { incr v 2 }
if {[matchattr $victim "|v" $chan]} { incr v 1 }
if {[matchattr $hand "n"]} { incr h 20000 }
if {[matchattr $hand "|n" $chan]} { incr h 10000 }
if {[matchattr $hand "m"]} { incr h 2000 }
if {[matchattr $hand "|m" $chan]} { incr h 1000}
if {[matchattr $hand "o"]} { incr h 200 }
if {[matchattr $hand "|o" $chan]} { incr h 100 }
if {[matchattr $hand "v"]} { incr h 2 }
if {[matchattr $hand "|v" $chan]} { incr h 1 }
return [expr $h - $v]
}
Note, this is not very complex, but the thought is.It would need lailoring to the way you use permissions.
IE, is a global voice, higher than a channel OP. In my channels, no, bu many would consider it
It will return a number, based on who has what. If the number is negative, the victim has more permissions that the kicker. If it's possative, the kicker has more permissions. If it is 0, then they are equal.
People that are not added to the bot, are considered as having no permissions. Thus, even if they are added, but have no flags, they are considered as having at least some permission. If neither are added to the bot, they are considered equal. If only one of the 2 has a record, but no flags, they are considered as having more permission.
Note, the number space between OP and Voices. This will allow you add "Helper" based permissions too. I don't know the flag, and can't be bothered.