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..

Old posts that have not been replied to for several years.
Locked
s
svahn
Voice
Posts: 19
Joined: Sun May 19, 2002 8:00 pm
Location: Sweden
Contact:

bind time..

Post by svahn »

hi!

i want a proc to be run every thursday at a specific time say 6.15pm.
how should the bind look like?

Code: Select all

bind time - "15 18 thu * *" <proc-name>
something like that?
can anyone tell me please :)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As noted in the documentation,t he time bind is matched against "min hour day month year".

This is not done via the day of the week however.

For this, and using your example, you could use

Code: Select all

bind time - "15 6 *" thurs:bind
proc thurs:bind {min hour day month year} {
  if {[clock format [clock seconds] "%A"] != "Thursday"} { return }

BLAH
}
s
svahn
Voice
Posts: 19
Joined: Sun May 19, 2002 8:00 pm
Location: Sweden
Contact:

Post by svahn »

Code: Select all

bind time - "15 6 *" thurs:bind
proc thurs:bind {min hour day month year} {
  if {[clock format [clock seconds] "%A"] != "Thursday"} { return }

BLAH
}
almost worked..

Code: Select all

if {[clock format [clock seconds] "%A"] != "Thursday"} { return }
i corrected it to

Code: Select all

if {[clock format [clock seconds] -format "%A"] != "Thursday"} { return }
Thanks for you help!
Locked