Jump to content

Countdown tray icon tooltip?(how?)


Recommended Posts

Hello! with the help of many people here I finally created my first ever autoit function. it repeats a set number of mouse moments every 35 minutes. Give warning at the 3 minute mark down to the 1 minute mark. and also has a tray icon tip that shows a count down timer in minutes. xD took me quite a while. I was wondering how would i be able to add a countdown timer in seconds when its only 1minute left, like 60, 59, 58, 57... etc as a trayicon tool tip. anyways here is the code I got so far:

Global $iCounter
Global $fLoop = True

HotkeySet("{Esc}", "Close")
While $fLoop
AutoItSetOption("MouseClickDelay", 100)
MouseClick("Left", 300, 790, 2)
MouseClick("Left", 400, 650, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
AutoItSetOption("MouseClickDownDelay", 100)
MouseClick("left", 790, 350, 2)
$iCounter = 35
        While $fLoop
        $iCounter -= 1
        TraySetState()
        TraySetToolTip($iCounter & " Minutes left.")
        Sleep(1000*60)

        If $iCounter = 0 Then ExitLoop
        If $iCounter = 5 Then Traytip("Bot", "5 Minutes left, there will be another warning at 1 minute.", 10)
        If $iCounter = 1 Then MsgBox(0, "LAST WARNING", "LAST WARNING!!" & $iCounter & " Minutes left!!", 10)

    WEnd
WEnd



Func Close()
    Exit
EndFunc
Edited by pikablue
Link to comment
Share on other sites

Hello! with the help of many people here I finally created my first ever autoit function. it repeats a set number of mouse moments every 35 minutes. Give warning at the 3 minute mark down to the 1 minute mark. and also has a tray icon tip that shows a count down timer in minutes. xD took me quite a while. I was wondering how would i be able to add a countdown timer in seconds when its only 1minute left, like 60, 59, 58, 57... etc as a trayicon tool tip. anyways here is the code I got so far:

Global $iCounter
Global $fLoop = True

HotkeySet("{Esc}", "Close")
While $fLoop
AutoItSetOption("MouseClickDelay", 100)
MouseClick("Left", 300, 790, 2)
MouseClick("Left", 400, 650, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
MouseClick("left", 450, 475, 2)
MouseClick("left", 475, 350, 2)
AutoItSetOption("MouseClickDownDelay", 100)
MouseClick("left", 790, 350, 2)
$iCounter = 35
        While $fLoop
        $iCounter -= 1
        TraySetState()
        TraySetToolTip($iCounter & " Minutes left.")
        Sleep(1000*60)

        If $iCounter = 0 Then ExitLoop
        If $iCounter = 5 Then Traytip("Bot", "5 Minutes left, there will be another warning at 1 minute.", 10)
        If $iCounter = 1 Then MsgBox(0, "LAST WARNING", "LAST WARNING!!" & $iCounter & " Minutes left!!", 10)

    WEnd
WEnd



Func Close()
    Exit
EndFunc
I would have done so, try to understand it.

$Min = 35
$Sec = 60
TraySetState()
TraySetToolTip($Min & ' Minutes left.')
$Timer = TimerInit()
While 1
    Sleep(10)
    If TimerDiff($Timer) > 1000 Then
        $Timer = TimerInit()
        $Sec -= 1
        If $Sec = 0 Then
            $Sec = 60
            $Min -= 1
            Switch $Min
                Case 0
                    ExitLoop
                Case 1
                    MsgBox(0, 'LAST WARNING', 'LAST WARNING!! 0 Minutes left!!', 10)
                    $Sec -= 10
                Case 5
                    TrayTip('Bot', '5 Minutes left, there will be another warning at 1 minute.', 10)
            EndSwitch
            TraySetToolTip($Min & ' Minutes left.')
        Else
            If $Min = 1 Then
                TraySetToolTip($Sec & ' Seconds left.')
            EndIf
        EndIf
    EndIf
WEnd
Edited by Yashied
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...