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.
Old posts that have not been replied to for several years.
Esoteric
Voice
Posts: 19 Joined: Mon Apr 11, 2005 1:08 pm
Post
by Esoteric » Sat May 07, 2005 9:23 pm
Can you make it so that with bind time that it executes every monday or tuesday or well you get the point.
-Erik
-Erik
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Sun May 08, 2005 12:46 am
No but you can bind to a specific time like 2am every day, then at the top of your proc put:
set day [lindex [split [clock format [clock seconds]]] 0]
if {$day != "Sun"} return
$day will be Sun, Mon, Tue, Wed, Thu, Fri, Sat so you can easily check to see if it's not the right day.
Esoteric
Voice
Posts: 19 Joined: Mon Apr 11, 2005 1:08 pm
Post
by Esoteric » Sun May 08, 2005 4:53 am
perfect thanks
-Erik
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Sun May 08, 2005 5:14 am
stdragon wrote: set day [lindex [split [clock format [clock seconds]]] 0]
if {$day != "Sun"} return
if { [clock format [unixtime] -format %a] != "Sun" } { return }
sounds much shorter, easier and faster to me ^-^.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under
The MIT License
Love hurts, love strengthens...
greenbear
Owner
Posts: 733 Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway
Post
by greenbear » Sun May 08, 2005 11:51 am
strftime to the rescue
Code: Select all
if ![string match [strftime %a] "Sun"] return
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Sun May 08, 2005 12:27 pm
[quote="De Kus"
if { [clock format [unixtime] -format %a] != "Sun" } { return }
sounds much shorter, easier and faster to me ^-^.[/quote]
Two things... first he said "monday or tuesday" so maybe he wants to expand it to be if {$day != "Mon" && $day != "Tue"} return, which I think is easier when you provide him with a nice little variable called $day. Second... shorter and faster... surely you're not trying to optimize a single line of code that takes less than 1/100000 of a second and only runs once a day!