Sign in to follow this  
Followers 0
HockeyFan

Help with Timer in Do/Until Loop

3 posts in this topic

Hello!

Can someone help me with a Do/Until loop that only waits 10 minutes to see if a condition is meet and then exits the loop?

I have the following Do/Until loop that currently waits until the registry key is created...

Do
    Sleep(5000)
    $RegKey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion\Tasks\{A14CD6FC-3BA8-4703-87BF-E3247CE382F5}", "szTaskName")
Until $RegKey = "AutoUpdate"

...but now I only want it to wait a maximum of 10 minutes.

Any help would be greatly appriciated! ;)

Thanks.

Share this post


Link to post
Share on other sites



$Timer = TimerInit
Do
    Sleep(5000)
    $RegKey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion\Tasks\{A14CD6FC-3BA8-4703-87BF-E3247CE382F5}", "szTaskName")
Until $RegKey = "AutoUpdate" or TimerDiff($Timer) > 60 * 10 *1000


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$Timer = TimerInit
Do
    Sleep(5000)
    $RegKey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion\Tasks\{A14CD6FC-3BA8-4703-87BF-E3247CE382F5}", "szTaskName")
Until $RegKey = "AutoUpdate" or TimerDiff($Timer) > 60 * 10 *1000

Thank You!! ;)

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