Sign in to follow this  
Followers 0
Guest someguy

Need help with script

5 posts in this topic

I was wondering if you could put in say a count down in ascript. TO have it press buttons after say 1hr and then after its done reset countdown to 1hr and keep running the main script. I just dont know the code i need to do it.

Thanks

Share this post


Link to post
Share on other sites



I was wondering if you could put in say a count down in ascript.  TO have it press buttons after say 1hr and then after its done reset countdown to 1hr and keep running the main script.  I just dont know the code i need to do it.

Thanks

while 1

sleep(60000)

do my thing

wend

;this will loop continuously


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

Thanks now do i put this at the end of my main script or in with my main script?

Share this post


Link to post
Share on other sites

I was wondering if you could put in say a count down in ascript.  TO have it press buttons after say 1hr and then after its done reset countdown to 1hr and keep running the main script.  I just dont know the code i need to do it.

Use a timer and test it every iteration of the loop:

$timer = TimerStart()

While TimerStop($timer) < 60 * 60 * 1000 ;1 hour = 60 seconds * 60 minutes * 1000 milliseconds
   ;your code goes here as required
WEnd

Please note that if your code doesn't include a sleep, you should probably use a Sleep(100) somewhere in the loop to prevent from maxing out your CPU.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0