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.

unban.tcl - scrip idea

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

unban.tcl - scrip idea

Post by Nexus6 »

Hello!
I'm on many nets, and I mainly deal with bots which keep huge channels clean of spam, as you have surely noticed spam bots are fast, and sometimes when they get banned they can get nick list and send spam. That's why I want channel bans to be active as long as possible, .set ban-time isn't a solution because channel usage is different in the morning and at night etc etc.
- How would unban.tcl work?

Unban.tcl would make bot scan channel ban list every "X" mins and if channel bans reached "Y" it would take off the oldest "Z" bans. So, for example a bot on DALnet could have settings like X - 5, Y - 95, Z - 5, so bot would scan channel ban list every 5 mins and if it reached 95 channel bans it would take off 5 the oldest channel bans.

Thanks in advance.
this is beginning I've stuck I don't know how to make bot count bans, and then if bans reach max value checking which ones are the oldest and unbainng Z bans.
#bleh
set bancheckt "5"
set maxbans "95"
set removebans "5"
set banchannel "#channel"
# code
if {![info exists banchecktimer_running]} {
timer $bancheckt banchecktimer
set banchecktimer_running 1
}

proc banchecktimer { } {
foreach bansentry [chanbans $banchannel] {
} 8)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

It's amazing, another user is looking for a script just like this.

As I replied in the other post, you can finish this script easily. To get the ban list, use chanbans. To count it, use llength. To unban the oldest Z entries, sort the ban list with lsort (according to age) and use a for loop to unban the old entries with putserv or killchanban.
Locked