lopolop Posted April 8, 2007 Posted April 8, 2007 (edited) can anyone tell me a better way to keep a timer.. basicaly i want to shutdown my computer after the given time is up For some reason this did not work.. $time=10800000 ;3 Hours... i think $i=0 while $i < $time $i=$i+1 ToolTip($i, 10, 10) sleep(1000) WEnd Shutdown(1) Edited April 8, 2007 by lopolop
BrettF Posted April 8, 2007 Posted April 8, 2007 So by what I can see, you want the computer to shut down in 3 hours right? Try this: #include <Date.au3> $cTime1 = _NowTime (5) $ctime = StringSplit ($cTime1, ":") $eTime = $cTime[1] + 3 & ":"& $ctime[2] &":"&$ctime[3] MsgBox (0, "", "Alarm Set: " & $ctime1 & @CRLF & "Alam Will Go Off At: " & $eTime) While 1 If _NowTime (5) = $eTime Then MsgBox (0, "Alarm!", "The Times up!") EndIf WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
improbability_paradox Posted April 8, 2007 Posted April 8, 2007 Personally, I would do it with TimerInit() and TimerDiff()
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