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.

permanent internal bans vs ban-time

General support and discussion of Eggdrop bots.
Post Reply
o
ohkine
Voice
Posts: 4
Joined: Thu Feb 04, 2010 5:29 am

permanent internal bans vs ban-time

Post by ohkine »

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
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: permanent internal bans vs ban-time

Post by willyw »

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 .
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.

or will i have to get some kind of black-list script?

cheers


Play around with this:

Code: Select all



######## 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.
Post Reply