Sign in to follow this  
Followers 0
Merchants

timer exit while the program is still running

3 posts in this topic

#1 ·  Posted (edited)

after 1 sec that the timer have runned it wil exit lol ?

Func 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 by Merchants

Share this post


Link to post
Share on other sites



yes that was it but very strange

i wil search that out

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0