Jump to content

Need help with script


Guest someguy
 Share

Recommended Posts

Guest someguy

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

Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...