Merchants Posted October 1, 2010 Share Posted October 1, 2010 (edited) after 1 sec that the timer have runned it wil exit lol ? expandcollapse popupFunc Load_Index1() GUICtrlDelete($GUI[1]) $GUI[1] = GUICtrlCreateLabel("1", 76, 122) $mode = 1 $run = 1 $GUITimer = GUICreate("Timer", 100, 30, -1, -1, -1, -1, WinGetHandle("")) GUICtrlCreateLabel("00:00", 11, 11, 80, 40) GUICtrlSetFont(-1, 25) GUISetStyle($WS_POPUP) GUISetState() $timer = TimerInit() AdlibEnable("Timer", 50) While $run ClipPut($index[0]) ControlClick($d2_Win, "", "", "Left", 1, 710,461) _SendEx("^v") If $p[0] = True Then HotKeySet("{NUMPADMULT}", "Password_Off") ClipPut($index[1]) _SendEx("{Tab}{Sleep 5}^v") Else HotKeySet("{NUMPADMULT}", "Password_On") EndIf ControlClick($d2_Win, "", "", "Left", 1, 678,421) Sleep($i) If PixelGetColor(109,9, $d2_Win) = 0xAC9C64 Then Else GUIDelete($GUITimer) $run = 0 EndIf WEnd EndFunc Func Timer() _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs) Local $sTime = $Time ; save current time to be able to test and avoid flicker.. $Time = StringFormat("%02i:%02i", $Mins, $Secs) If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time) EndFunc and this one works fine.. ; *** Demo to show a timer window #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Date.au3> Opt("TrayIconDebug", 1) Opt("MustDeclareVars", 1) Global $timer, $Secs, $Mins, $Hour, $Time _Main() Func _Main() ;Create GUI GUICreate("Timer", 100, 30) GUICtrlCreateLabel("00:00", 11, 11, 80, 40) GUICtrlSetFont(-1, 25) GUISetStyle($WS_POPUP) GUISetState() ;Start timer $timer = TimerInit() AdlibEnable("Timer", 50) While 1 WEnd EndFunc ;==>_Main ; Func Timer() _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs) Local $sTime = $Time ; save current time to be able to test and avoid flicker.. $Time = StringFormat("%02i:%02i", $Mins, $Secs) If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time) EndFunc ;==>Timer Edited October 1, 2010 by Merchants Link to comment Share on other sites More sharing options...
dwerf Posted October 1, 2010 Share Posted October 1, 2010 Maybe because of this construction? If PixelGetColor(109,9, $d2_Win) = 0xAC9C64 Then Else GUIDelete($GUITimer) $run = 0 EndIf Link to comment Share on other sites More sharing options...
Merchants Posted October 2, 2010 Author Share Posted October 2, 2010 yes that was it but very strange i wil search that out Link to comment Share on other sites More sharing options...
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