Jump to content

Recommended Posts

Posted

Sigh, try to search for ToolTip? or TrayTip?

AlmarM

I know the tooltip command, but would you have to make another variable?
Posted

No... Next time, look at things and look hard. (I haven't tested this, so if it doesn't work, you can look through it yourself.)

#include <GUIConstants.au3>

Global $wHour, $wMins, $isCounting = False, $rHour, $Mins

$hGui = GUICreate("Shutdown Bot", 297, 44, 307, 303)
GUICtrlCreateLabel("Hours:", 8, 8, 43, 17)
$mHour = GUICtrlCreateInput("", 56, 8, 49, 21)
GUICtrlCreateLabel("Mins:", 120, 8, 29, 17)
$mMins = GUICtrlCreateInput("", 152, 8, 57, 21)
$Start = GUICtrlCreateButton("Start", 216, 8, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
        AdlibEnable("GetTime", 1000)
            $rHour = GUICtrlRead($mHour)
            $rMins = GUICtrlRead($mMins)
            
        TrayTip("Shutdown Bot", "Time left: " & $rHour & ":" & $rMins, 1)

            $isCounting = True; We're counting!
            While $isCounting = True
                If $wHour = $rHour And $wMins = $rMins Then
                    Shutdown(1); Shutdown
                EndIf
            WEnd
    EndSwitch
WEnd

Func GetTime()
    $wHour = @HOUR
    $wMins = @MIN
EndFunc

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
×
×
  • Create New...