Jump to content

Recommended Posts

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
Posted

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
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]

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
  • Recently Browsing   0 members

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