egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RemoveBans.tcl Problems

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
CyberWar
Voice


Joined: 04 Feb 2008
Posts: 36

PostPosted: Mon Apr 07, 2008 10:52 am    Post subject: RemoveBans.tcl Problems Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Apr 07, 2008 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
CyberWar
Voice


Joined: 04 Feb 2008
Posts: 36

PostPosted: Mon Apr 07, 2008 11:23 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Apr 07, 2008 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber