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.

RemoveBans.tcl Problems

Support & discussion of released scripts, and announcements of new releases.
Post Reply
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

RemoveBans.tcl Problems

Post by CyberWar »

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: Select all

#  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)"
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

#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
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

oh ok

hm then i need a script where remove all bans in 24hours. i can't find a script on egghelp.org
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Then you'd have to modify the proc accordingly:

Code: Select all

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