| View previous topic :: View next topic |
| Author |
Message |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Mon Apr 07, 2008 10:52 am Post subject: RemoveBans.tcl Problems |
|
|
Hi all i've tested this Script. But this one does not work, i've set the timer for removing bans all 24Hours, but he dont remove ban's. Whats wrong?
| Code: | # RemoveBans.tcl by Nils Ostbjerg <shorty@business.auc.dk>
# (C) Copyright (2001)
#
# This script makes the bot remove all bans set on channel once every
# 15 minutes. Edid the time bind below to change fequency.
#
# This version of the RemoveBans script is tested on Eggdrop version
# 1.6.x
#
# Please report any bugs to me at shorty@business.auc.dk.
# Idea and suggestion to new features are also welcome.
#
# - Nils Ostbjerg <shorty@business.auc.dk>
#
# Version 1.6.0 - 01 Nov 2001 First version, should work ok.
# - Nils Ostbjerg <shorty@business.auc.dk>
bind time - "* * 1 * *" time:removebans
##########################################################################
# time:RemoveBans start #
##########################################################################
proc time:removebans {min hour day month year} {
foreach chan [channels] {
resetbans $chan
}
}
##########################################################################
# time:RemoveBans end #
##########################################################################
##########################################################################
# putlog #
##########################################################################
putlog "Loaded RemoveBans (DLF)"
|
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Apr 07, 2008 11:10 am Post subject: |
|
|
First off, your time binding is incorrect. It seems to try and match whenever it's the first day in the month (which, if had been done properly, would cause the script to be triggered once every minute for the whole day, and doing nothing the rest of the month). However, "minute", "hour", "day", "month" are always 2 characters long, and zero-padded when necessary, and "year" is always 4 characters long.
Use something like this for your binding instead:
| Code: | #Reset bans at 7am every morning
bind time - "00 07 *" time:removebans |
Next, calling resetbans will not remove all bans, but only bans not managed by your eggdrop. The description in the script might be somewhat misleading.
| doc/tcl-commands.doc wrote: | resetbans <channel>
Description: removes all bans on the channel that aren't in the bot's
ban list and refreshes any bans that should be on the channel but
aren't
Returns: nothing
Module: irc
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Mon Apr 07, 2008 11:23 am Post subject: |
|
|
oh ok
hm then i need a script where remove all bans in 24hours. i can't find a script on egghelp.org |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Apr 07, 2008 6:20 pm Post subject: |
|
|
Then you'd have to modify the proc accordingly:
| Code: | proc time:removebans {min hour day month year} {
foreach chan [channels] {
foreach ban [chanbans $chan] {
pushmode $chan -b [lindex $ban 0]
}
}
} |
However, have you simply tried setting the channel +dynamicbans and "ban-time 1440"? This would cause your eggdrop to automatically remove any un-needed bans whenever they get older than 24h _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|