I am looking for a script that will clear the channel banlist before it is full.
I tried banlistcleaner.tcl that is onsite but it only seams to adjust the channel banlist when the bot first enters a room. When channel banlist fills up again it dont flush it.
Idealy, the script would remove X number of bans when the channel banlist reached X number of bans in it. Preventing a channel banlist from reaching the maximum channel banlist.
any help would be appreciated.
#
# dynamicbans
# Only activate bans on the channel when necessary? This keeps
# the channel's ban list from getting excessively long. The bot
# still remembers every ban, but it only activates a ban on the
# channel when it sees someone join who matches that ban.
#
....
# Set here the maximum number of bans you want the bot to set on a channel.
# Eggdrop will not place any more bans if this limit is reached. Undernet
# currently allows 45 bans, IRCnet allows 30, EFnet allows 100, and DALnet
# allows 100.
set max-bans 30
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
This is actually the old banlist cleaner. I edited this script recently to be free from of all kinds of bugs and errors and added new functions, like "ALL" to remove all channel bans. Here you go, it should work fine!
bind join - "*" banlist:clean:on:join
bind mode - "*" banlist:clean:on:mode
#Remove bans if they go over this number
set banlistmax "100"
#Set the type/order in which you would like to remove the channel bans.
#USAGE: [1/2/3] (1=RANDOM BANS, 2=RECENT PLACED BANS, 3=LAST PLACED BANS)
#Use '1' If you want to remove bans 'randomly' from the channel's banlist.
#Use '2' If you want to remove 'recent placed bans' (increasing banlist) from the channel's banlist.
#Use '3' If you want to remove 'last placed bans' (decreasing banlist) from the channel's banlist.
#Use '4' If you want to remove all bans placed by the bot from the channel's banlist.
set banlisttype "3"
#No of bans to remove 'ALL' or 'any number: 10, 50, 125'
set banlistremove "30"
#Minutes after bot join to check the channel for bans
set banlistdelaycheck "5"
proc banlist:clean:on:join {nick uhost hand chan} {
global banlistdelaycheck
if {[isbotnick $nick]} {
timer $banlistdelaycheck [list banlist:clean:on:mode $nick $uhost $hand $chan "+b" "on:join"]
}
}
proc banlist:clean:on:mode {nick uhost hand chan mode target} {
global botnick banlistmax banlisttype banlistremove
if {[string is integer $banlistremove] && ($banlistremove > $banlistmax)} { return 0 }
if {[string equal "+b" $mode] && [botisop $chan]} {
if {[llength [chanbans $chan]] >= $banlistmax} {
if {$banlisttype == "1"} {
set banlist [chanbans $chan]
} elseif {$banlisttype == "2"} {
set banlist [lsort -index 2 -integer -increasing [chanbans $chan]]
} elseif {$banlisttype == "3"} {
set banlist [lsort -index 2 -integer -decreasing [chanbans $chan]]
} elseif {$banlisttype == "4"} {
set banlist [list]
foreach ban [chanbans $chan] {
if {[string equal -nocase "[lindex [split [lindex $ban 1] !] 0]" $botnick]} {
lappend banlist $ban
}
}
}
if {[string is integer $banlistremove]} {
set removebans [lrange $banlist 0 [expr $banlistremove - 1]]
putserv "ONOTICE $chan :Channel banlist currently has $banlistmax entries. Removing the last $banlistremove bans placed."
foreach ban $removebans {
pushmode $chan -b [lindex $ban 0]
}
flushmode $chan
return 0
} elseif {[string equal -nocase "all" $banlistremove]} {
putserv "ONOTICE $chan :Channel banlist currently has $banlistmax entries. Clearing the channel banlist."
resetbans $chan
return 0
}
}
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
No, the script should be just fine even after you delete those two lines. Those lines just send an OPNOTICE to the channel, before they start removing bans from the banlist.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================