| View previous topic :: View next topic |
| Author |
Message |
ohkine Voice
Joined: 04 Feb 2010 Posts: 4
|
Posted: Sat Aug 07, 2010 5:26 am Post subject: permanent internal bans vs ban-time |
|
|
Hi there, i'm afraid i might know the answer to this, but i was hoping someone could clarify just to be sure:
Suppose i have the following eggdrop options set on my channel:
+dynamicbans
-enforcebans
+userbans
ban-time 30
force-expire 0
Then i have a number of 'permanent' bans in eggdrop's internal ban list, and i would like it so that eggdrop automatically removes these bans from the channel list after a period of time (30 minutes), whilst keeping them in the internal list in case the ban is triggered later. So far so good, this works fine.
However, eggdrop is ALSO removing bans that have been added directly to the channel ban list (NOT to the internal one). I would like it to NOT do this.
Is there any way to accomplish what i want through eggdrop itself, or will i have to get some kind of black-list script?
cheers |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun Aug 08, 2010 10:44 pm Post subject: Re: permanent internal bans vs ban-time |
|
|
| ohkine wrote: |
...
However, eggdrop is ALSO removing bans that have been added directly to the channel ban list (NOT to the internal one). I would like it to NOT do this.
|
To stop that, I believe you'll need to set ban-time to 0 .
| Quote: |
Is there any way to accomplish what i want through eggdrop itself,
|
I don't think so.
Hopefully someone else, with a lot of experience, will comment on this too.
| Quote: |
or will i have to get some kind of black-list script?
cheers
|
Play around with this:
| Code: |
######## Config
# Set the channel of bot's internal ban list, that will be examined
set chan_to_check "#yourchannel"
# Set the age of ban - in seconds - that if the ban is this old, then it will be removed
# from Channel ban list (not bot's internal list)
set expire_time "1800"
########## End Config
bind time - "* * * * *" check_bans
proc check_bans {min hour day month year} {
global expire_time chan_to_check
if {![botonchan $chan_to_check]} {
return 0
}
foreach b [chanbans $chan_to_check] {
lappend bb [lindex $b 0]
}
foreach ban [banlist $chan_to_check] {
if {([expr [unixtime] - [lindex $ban 3]] > $expire_time) && ([lsearch -exact $bb [lindex $ban 0]] != -1)} {
pushmode $chan_to_check -b [lindex $ban 0]
}
}
}
|
Hopefully, I've understood what you need.
Outline:
It runs once every minute. (Not sure if this is wise - again, maybe someone else will comment )
It goes through the bot's internal ban list for the channel you have configured, checking each ban. If a ban is older than the amount of time you have configured, AND if that ban also exists in the Channel's ban list, then unban it from the channel, while leaving it alone in the bot's internal ban list. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|