Page 1 of 1 1
Topic Options
#131416 - 2004-12-16 09:36 AM reset variable value
jadewith Offline
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 Offline
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
#131418 - 2004-12-16 09:57 AM Re: reset variable value
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Why a variable ?
For me this indicates a @time conditional if-endif thing .... May be wrong though, any code to share ?

[edit: oh yeah, twice an hour, I see the need for that flag variable now, still, can you post code to build on?]


Edited by Jochen (2004-12-16 10:00 AM)
_________________________



Top
#131419 - 2004-12-16 10:13 AM Re: reset variable value
terron Offline
Fresh Scripter

Registered: 2004-12-08
Posts: 11
Loc: Tyler, TX
I think I understand what you're asking, try using the external program now.exe in the NT toolkit.. http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTKit.asp

Hope that helps

Top
#131420 - 2004-12-16 10:28 AM Re: reset variable value
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Instead of running it 24/7 why not run it with Task Scheduler which supports multiple times
Top
#131421 - 2004-12-16 07:53 PM Re: reset variable value
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure about that approach...
can do, ofcourse.

I just don't get it what is hard in simple thing like (remember, this was said not to be starter question):
Code:

"looping"
do
$hour=left(@time,2)
select
case kbhit
quit
case 8<$hour and 17>$hour
$sleepy=30
;execute the checker
case 17<$hour and 24>$hour
$sleepy=60
;execute the checker
endselect
sleep 60*$sleepy
until 1=0



or then I read the thing wrong...
_________________________
!

download KiXnet

Top
#131422 - 2004-12-16 07:55 PM Re: reset variable value
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh and, saying update runs 24/7 must be kidding.
if you really go on and loop 24/7 as much as your script can take, all the time peaking the cpu, you are actually dDoSing that webpage machine.
_________________________
!

download KiXnet

Top
#131423 - 2004-12-16 09:44 PM Re: reset variable value
Bryce Offline
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
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 871 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org