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.
Old posts that have not been replied to for several years.
-
m
mistis
Post
by mistis »
anyone can help me coding the tcl script to clearing banlist. 10 old banlist will be removed if banlist reach 100 (full)
-
stdragon
- Owner
- Posts: 959
- Joined: Sun Sep 23, 2001 8:00 pm
-
Contact:
Post
by stdragon »
To get the banlist:
set bans [banlist #channel]
To unset a ban:
killchanban #channel <ban>
To unset the first 10 bans:
set bans [banlist #channel]
for {set i 0} {$i < 10} {incr i} {
killchanban #channel [lindex $bans $i]
}
-
m
mistis
Post
by mistis »
I have made a code like this,
but why it doesnt work
set maxbans 100
bind mode - "*+b*" auto_unban
proc auto_unban {nick uhost hand chan mode victim} {
global botnick maxbans banfull
set numbanlist [llength [banlist $chan]]
if { $numbanlist >= $maxbans && [botisop $chan]} {
set bans [banlist $chan]
for {set i 0} {$i < 10} {incr i} {
killchanban $chan [lindex $bans $i]
}
}
}
return 1
putlog "bansfull.tcl"
-
stdragon
- Owner
- Posts: 959
- Joined: Sun Sep 23, 2001 8:00 pm
-
Contact:
Post
by stdragon »
Who knows, put some debugging statements in your proc to see what's going on. Maybe it's a config problem.
Put stuff like this in:
putlog "there are $numbanlist bans"
inside your if test
putlog "inside if"
in your else
putlog "in else instead"
in your loop
putlog "removing ban [lindex $bans $i]"
etc...
then you can see what's going wrong