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 

[SOLVED] Help with a timmer that doesnt want to work..

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Tue May 18, 2010 5:44 am    Post subject: [SOLVED] Help with a timmer that doesnt want to work.. Reply with quote

hi guys...

the script works fine with the public trigger its the time bind im having a problem with :/

i would like it to check every 60 minutes and set the limit if it needs to +10

so my question is does anyone know why the time bind wont work ?

Code:
bind pub -|- -limit SaNcTuM_limit

bind time -|- "* 1 * * *" SaNcTuM_limit


proc SaNcTuM_limit{min hour day month year} {
    foreach chan [channels] {
   putlog "SaNcTuM_limit timer ok"
   set newlimit [expr [llength [chanlist $chan]] + 10]
   set currentlimit [currentlimit $chan]
   if {$currentlimit < [expr $newlimit - 1] || $currentlimit > [expr $newlimit + 1]} {
       putserv "mode $chan +l $newlimit"
   }
        }   
 }


proc currentlimit {chan} {
    set currentmodes [getchanmode $chan]
    if {[string match "*l*" [lindex $currentmodes 0]]} {
   return [lindex $currentmodes end]
    }
    return 0
}


putlog "SaNcTuM_limit"


thanks... Smile
_________________
NON geeky!! http://gotcode4u.com/


Last edited by doggo on Tue May 18, 2010 8:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue May 18, 2010 3:44 pm    Post subject: Reply with quote

Your mask is not correct.
It would match whenever the hour value is 1. However, single-digit values are 0-padded to 2 (4 for year) digits; that is, 1 o'clock is actually 01.

But, you should not match the hour at all, but the minutes. The minute value will match a fixed value once every hour - which is what you'll want:
Examples:
Code:
#trigger every hour, on the hour:
bind time - "00 * * * *" proc

#trigger every hour, 15 minutes past the hour:
bind time - "15 * * * *" proc

#trigger every hour, 5 minutes past - more compact mask:
bind time - "05 *" proc

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Tue May 18, 2010 8:12 pm    Post subject: Reply with quote

nml375 wrote:
Your mask is not correct.
It would match whenever the hour value is 1. However, single-digit values are 0-padded to 2 (4 for year) digits; that is, 1 o'clock is actually 01.

But, you should not match the hour at all, but the minutes. The minute value will match a fixed value once every hour - which is what you'll want:
Examples:
Code:
#trigger every hour, on the hour:
bind time - "00 * * * *" proc

#trigger every hour, 15 minutes past the hour:
bind time - "15 * * * *" proc

#trigger every hour, 5 minutes past - more compact mask:
bind time - "05 *" proc


Cheers nml375

i totaly see where i was messing it up now Wink
_________________
NON geeky!! http://gotcode4u.com/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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