This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

automatic ban cleaner (with a resetter maxbanlist)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

automatic ban cleaner (with a resetter maxbanlist)

Post by Arnold_X-P »

writing of awyeah
The TCL works fine, the problem is that when the ban list is full, the message is repeated twice when sent.
example:
NOTICE @$chan :BANLIST FULL: WARNING
or
NOTICE @$chan :BANLIST FULL: WARNING

Code: Select all

 ######################################
## -------------------------------- ##
##  Channel Banlist Cleaner Script  ##
## -------------------------------- ##
######################################


#Set the channels you want this script activated on
set banlistchans "*"

# 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 85

######  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
}
Last edited by Arnold_X-P on Wed Apr 30, 2025 12:00 am, edited 1 time in total.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
s
simo
Revered One
Posts: 1122
Joined: Sun Mar 22, 2015 2:41 pm

Re: automatic ban cleaner

Post by simo »

you could try and change this line from :

Code: Select all

if {(([lsearch -exact [string tolower $banlistchans] [string tolower $chan]] != -1) || ($banlistchans == "*")) && ($mode == "+b") && ($numbanlist >= $maxbanlist)} {
to :

Code: Select all

if {(([lsearch -exact [string tolower $banlistchans] [string tolower $chan]] != -1) || ($banlistchans == "*")) && ($mode == "+b") && ($numbanlist == $maxbanlist)} {
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: automatic ban cleaner

Post by Arnold_X-P »

thanks simo
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
Post Reply