Sign in to follow this  
Followers 0
endofworld

Is there any ways to pause the script?

8 posts in this topic

Hi all expert, is there anyway to pause my script for 30minutes after 1 hour or so?

Share this post


Link to post
Share on other sites



What i mean is to pause the script for few minutes or hours and start it again after every 1 hour or earlier.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Is there any guides for me to do so?

I need a guide in pausing my script for few minutes then start again automatically, is that possible?

Share this post


Link to post
Share on other sites

Sleep(milliseconds) 1000-1second

Share this post


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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi all expert, is there anyway to pause my script for 30minutes after 1 hour or so?

I would add AdlibRegister like that:

AdlibRegister("SleepTime",3600000) ; SleepTime() every 1 hour
Func SleepTime()
Sleep(1800000) ; 30 min
;AdlibUnregister("SleepTime") ;if you want just once
EndFunc
Edited by VixinG

[indent=3][/indent]

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