#131416 - 2004-12-16 09:36 AM
reset variable value
|
jadewith
Fresh Scripter
Registered: 2003-06-13
Posts: 45
Loc: Good ole U S of A
|
I know that my title may seem a bit deceiving but this is not a starters question. I currently have a script that runs on a dedicated W2k box using kixtart 4.20. Basically, it goes to 2 websites and clicks the update button on each. I want to run this script 24/7. Which will work, I have tested this and it is fine. My problem is that I would also like to click the update button of a third site, but this site can only be updated twice an hour between 9a-5p and then 4 times total between 5p-11:50p. For a complete total of 20 times, but only on the third site.
|
|
Top
|
|
|
|
#131417 - 2004-12-16 09:39 AM
Re: reset variable value
|
jadewith
Fresh Scripter
Registered: 2003-06-13
Posts: 45
Loc: Good ole U S of A
|
I have the idea of setting a variable to evaluate off of but how do I reset the variable on the new day with in a loop?
|
|
Top
|
|
|
|
#131423 - 2004-12-16 09:44 PM
Re: reset variable value
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
try this, needs the UDF FlipcTime()
Code:
$24h = flipctime(@date,"00:00:00"),flipctime(@date,"00:00:00")+86400 $9a = $24h[0]+32400 $5p = $24h[0]+61200 $1150p = $24h[0]+85800
while 1 select case flipctime(@date,@time) > $9a AND flipctime(@date,@time) < $5p ;this time period if for operations between 9am and 5pm
case flipctime(@date,@time) > $5p and flipctime(@date,@time) < $1150p ;this time period is between 5pm and 11:50pm
case flipctime(@date,@time) > $24h[1] ;this will reset all time variables to equal the new days values. $24h = flipctime(@date,"00:00:00"),flipctime(@date,"00:00:00")+86400 $9a = $24h[0]+32400 $5p = $24h[0]+61200 $1150p = $24h[0]+85800 endselect loop
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 847 anonymous users online.
|
|
|