Well, its really very simple.
Here give it a go.
Code: Select all
######################################
## -------------------------------- ##
## Channel Banlist Cleaner Script ##
## -------------------------------- ##
######################################
#Set the channels you want this script activated on
set banlistchans "#elite"
# Change this variable to how many bans you dont want
# your banlist to go past. Most DALnet servers dont
# allow more than 100, so you should keep it around 98.
set maxbanlist 98
###### Don't change anything below here ######
###### unless you know what you are doing! ######
bind mode - "*+b*" clear:banlist
proc clear:banlist {nick uhost hand chan mode arg} {
global botnick banlistchans maxbanlist
set numbanlist [llength [chanbans $chan]]
if {(([lsearch -exact [string tolower $banlistchans] [string tolower $chan]] != -1) || ($banlistchans == "*")) && ($mode == "+b") && ($numbanlist >= $maxbanlist)} {
if (![botisop $chan]) {return 0}
putserv "NOTICE @$chan :BANLIST FULL: WARNING - $chan's banlist was detected to be *full* of nearly 100 entries, with $numbanlist bans."
putserv "NOTICE @$chan :CLEARING BANLIST: The banlist for $chan is now being *cleared* to 0 entries."
putlog "BANLIST: Clearing the banlist of $chan, as it is full."
utimer 3 "resetbans $chan"
}
return 0
}
You can change the putserv commands if you like, or remove them. Basically I've set it according to my needs, also the formatting of bolds and control codes in it.
They just send out a notice to all active OPS like "/ONOTICE" saying that the channel banlist was near to be full and I am clearing out the banlist, nothing much, rest is simple as well.
If you find a script, or get one to make it like remove the earliest, 10, 20 bans in the banlist, I would surely love it. Also if anyone can help me out to build a script like that, with this one I would be glad.