Jump to content

Is there any ways to pause the script?


Recommended Posts

There are far too many ways to interpret what you want to do, which leads to many more possibilities for a solution. When you can, please clarify your intentions.

My first thought is to make whatever program/script you're making a scheduled task. You could also play around with the Sleep() and _Date_Time_GetSystemTime() in a For/Do or Do/Until loop........ Anyways, there are infinite possibilities (thanks to the dev team)...

Edited by Colyn1337
Link to comment
Share on other sites

Something like this? Yu have it in help file...

$hTimer = TimerInit() ; Begin the timer and store the handle in a variable.
$sleepTime = 3000 ;sleep is in ms if you want in seconds * 1000 (script pause time)
$time = 3 600 000 ;1 hour in ms (Time for scrip to run)

While 1
  
   $iDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff.
  
   If $iDiff >= $time Then
  
   Sleep($sleepTime)
   MsgBox(0, "Msg", "Script was running for " & $time)
   ExitLoop
  
   EndIf
  
WEnd
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...