Guest User

Untitled

a guest
Sep 7th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #SingleInstance, Force
  3. SetBatchLines, -1
  4.  
  5. ; ---------------------- PROJECT CODE BELOW ----------------------
  6.  
  7. Menu, Tray, Icon, Shell32.dll, 3 ; Custom Icon pulled from Shell32
  8. Menu, tray, tip, %A_ScriptName% ; Custom traytip
  9.  
  10. Gui, GUI_Overlay:New, +ToolWindow +LastFound +AlwaysOnTop -Caption +hwndGUI_Overlay_hwnd
  11. Gui, Margin, 10, 10
  12. Gui, Font, s40 q4, Segoe UI Bold
  13. Gui, Add, Text, w400 Center vTEXT_Timer cWhite, %timerCount% seconds
  14. Gui, Color, 000000
  15. WinSet, Transparent, 200
  16. TimerCount := 0
  17.  
  18. ; Trigger hotkey
  19. 2::
  20.     If (TimerCount == 0)
  21.     {
  22.         timerCount := 20 ; Change me
  23.         SetTimer, Timer_Countdown, 1000
  24.     }
  25.     GuiControl, GUI_Overlay:, TEXT_Timer, %timerCount% seconds
  26.     Gui, GUI_Overlay:Show, x20 y20 NoActivate
  27. return
  28.  
  29. ; Does the countdown and updating of the timer
  30. Timer_Countdown:
  31.     if (timerCount == 1) {
  32.         SetTimer, Timer_Countdown, Off
  33.         Gui, Gui_Overlay:Hide
  34.     }
  35.     timerCount--
  36.     GuiControl, GUI_Overlay:, TEXT_Timer, %timerCount% seconds
  37. return
  38.  
  39. Esc::
  40. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment