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.

bind time, each quarter, (but hourly an extra command)

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
DarkDeviL
Voice
Posts: 10
Joined: Sun Jul 03, 2005 4:29 pm
Location: Denmark
Contact:

bind time, each quarter, (but hourly an extra command)

Post by DarkDeviL »

Hey!

As I said in the topic, I have it like:

Code: Select all

bind time - "0 * * * *" ac_quarter
bind time - "15 * * * *" ac_quarter
bind time - "30 * * * *" ac_quarter
bind time - "45* * * *" ac_quarter

proc ac_quarter {min hour day month year} {
  if {$min=="0"} {
    ac_check
    timer 1 ac_check2
  } else {
    ac_check 
 }
}
Hourly, I want to do the same as each quarter, but additional an extra command should be used too, is this impossible?

I tried with if {$min=="0"}, and if {!$min} {, no one of them works hourly.

But if I do '.tcl ac_quarter 0 <some more bullshit here>', it works fine..

Simply, it ignore the hourly change when doing it automatically..

It should use ac_check hourly, and one minute after ac_check2.

If I remove ALL of the if-then-else stuff, it works fine each quarter.

Someone who know what the problem is?
DarkDeviL.
E-mail: append '@staynet.org' to 'darkdevil'.
WWW: www.DarkDeviL.dk
IRC: #DarkDeviL, at irc.staynet.org
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

if {[string equal 00 $min]} {
User avatar
DarkDeviL
Voice
Posts: 10
Joined: Sun Jul 03, 2005 4:29 pm
Location: Denmark
Contact:

Post by DarkDeviL »

Sir_Fz wrote:Try

Code: Select all

if {[string equal 00 $min]} {
00 ?

Is it "00 * * * *" (zero twice) when the hour changes?

if, then it's the bind there's wrong? :shock:
DarkDeviL.
E-mail: append '@staynet.org' to 'darkdevil'.
WWW: www.DarkDeviL.dk
IRC: #DarkDeviL, at irc.staynet.org
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

True! good eye there DarkDevil, it should be 00 in the bind and it will work perfectly as it is (without using the line I gave you).
User avatar
DarkDeviL
Voice
Posts: 10
Joined: Sun Jul 03, 2005 4:29 pm
Location: Denmark
Contact:

Post by DarkDeviL »

Isn't that a bug in the eggdrop then?

I just checked my crontab, in there the '0 * * * * <command>' works fine. :o
DarkDeviL.
E-mail: append '@staynet.org' to 'darkdevil'.
WWW: www.DarkDeviL.dk
IRC: #DarkDeviL, at irc.staynet.org
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

DarkDeviL wrote:Isn't that a bug in the eggdrop then?

I just checked my crontab, in there the '0 * * * * <command>' works fine. :o
Not necessary a bug, it maybe takes it as a string 00 rather than a number. btw

Code: Select all

bind time - "00 * * * *" ac_quarter
can be reduced to

Code: Select all

bind time - "00 *" ac_quarter
since '*' matches everything (including spaces).
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

DarkDeviL wrote:Isn't that a bug in the eggdrop then?

I just checked my crontab, in there the '0 * * * * <command>' works fine. :o
eggdrop has nothing to do with crontab, so requiring 00 is not a bug
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply