brodie28 Posted August 12, 2006 Posted August 12, 2006 I need the script to take a break every six hours for half an hour.... This is how I tried to do it. Please forgive the crappy variable naming and etc. While 1 $dif = Timerdiff($begin) $qwe = 21600000 * $number If $dif > $qwe Then sleep(1800000) $number = $number + 1 EndIf <my function goes here> sleep(50000) Wend
brodie28 Posted August 12, 2006 Author Posted August 12, 2006 Forgot to add... What happens at the moment is it takes a break after six hours... And then never starts up again.
AzKay Posted August 12, 2006 Posted August 12, 2006 Cant you just Sleep() for 6 hours? # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Valuater Posted August 12, 2006 Posted August 12, 2006 I need the script to take a break every six hours for half an hour.... This is how I tried to do it. Please forgive the crappy variable naming and etc. While 1 $dif = Timerdiff($begin) $qwe = 21600000 * $number If $dif > $qwe Then sleep(1800000) $number = $number + 1 EndIf <my function goes here> sleep(50000) Wend after 6 hours of running... $qwe = 21600000 * $number (21600000 = 6 hours) then the program sleeps for 1800000 or 30 minutes * so the only reason it sleeps at all if after $dif > 6 hours ( other than the 5 seconds ) 8)
PsaltyDS Posted August 12, 2006 Posted August 12, 2006 I need the script to take a break every six hours for half an hour.... This is how I tried to do it. Please forgive the crappy variable naming and etc. While 1 $dif = Timerdiff($begin) $qwe = 21600000 * $number If $dif > $qwe Then sleep(1800000) $number = $number + 1 EndIf <my function goes here> sleep(50000) Wend Repeats _MyFunction() forever, taking a 30min break every 6hr: $iTimer6 = TimerInit() While 1 _MyFunction() ; <my function goes here> If TimerDiff($Timer6) >= 1000 * 60 * 60 * 6 Then ; If 6 hours have passed... Sleep(1000 * 60 * 30) ; 30min delay $Timer6 = TimerInit() ; Restart 6 hour timer EndIf Wend Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now