=sinister= 1 Report post Posted August 29, 2005 Ok, I have a clock for autoit and I need it to stay on the screen for 15 seconds, then move on to another command. Right now it will keep looping. Please help! Thanks! The clock: expandcollapse popupGlobal $sec = @SEC, $minute, $hour, $light, $time, $clocklabel opt("WinWaitDelay", 100) opt("WinTitleMatchMode", 4) opt("WinDetectHiddenText", 1) opt("MouseCoordMode", 0) GUICreate("Max's Clock", 200, 50, (@DesktopWidth - 188) / 2, (@DesktopHeight - 59) / 2) $clocklabel = GUICtrlCreateLabel("Loading...", 5, 5, 190, 40, 0x1000) GUICtrlSetFont($clocklabel, 24) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop ElseIf $sec <> @SEC Then GUICtrlSetData($clocklabel, TimeSet()) AlarmCheck(TimeSet()) EndIf WEnd Exit Func AlarmCheck($time) ;Alarm function(configure how wanted) EndFunc ;==>AlarmCheck Func Close() Exit EndFunc ;==>Close Func TimeSet() $light = " AM" $hour = @HOUR $minute = @MIN $sec = @SEC If $hour = 0 Then $hour = 12 ElseIf $hour = 12 Then $light = " PM" ElseIf $hour > 12 Then $hour = (@HOUR) - 12 $light = " PM" EndIf $time = $hour & ":" & $minute & ":" & $sec & $light Return $time EndFunc ;==>TimeSet Share this post Link to post Share on other sites
Confuzzled 1 Report post Posted August 29, 2005 Sleep(15000) do the job? Share this post Link to post Share on other sites
SmOke_N 199 Report post Posted August 29, 2005 Or: $Timer = TimerInit() Do ;script Until TimerDiff($Timer) / 1000 >= 15 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites