Countdown Window with Multiple Countdowns Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
j1ffe
Posts: 1
Joined: 15 Aug 2022, 00:23

Countdown Window with Multiple Countdowns

Post by j1ffe » 15 Aug 2022, 00:36

I've been reading a ton of countdown scripts and trying to modify them to fit what I need but I haven't been able to get anything to work. What I'm trying to do is have a GUI window that shows a countdown timer and when it hits 0 I want it to start another countdown right away. Most of the scripts I've seen have some kind of input but I was trying to set it up where you press a hotkey and then a set of a bunch of different countdowns all play one after each other in the same window. The main problem I'm having is I don't know how to make the countdown variable show its current value without printing every second it counts down.

Code: Select all

timer(t){
Gui, Font, s20
loop{
Gui, Add, Text,, %t%
Gui, Show, x0 y0 w100 h1000
t += -1
sleep 1000
} until t <=0


}

Capslock::
timer(14)
timer(21)
timer(10)
timer(22)

^j::exitapp
I would really appreciate any help here, thanks. :D

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Countdown Window with Multiple Countdowns  Topic is solved

Post by BoBo » 15 Aug 2022, 01:09

Code: Select all

#SingleInstance Force
Gui, -caption +border
Gui, Font, s18
Gui, Add, Text, vText center,

timer(t){
   Loop
      {  GuiControl,, Text,% t
         Gui, Show,% "x" A_ScreenWidth/2 " y" A_ScreenHeight/2
         t += -1
         Sleep 1000
      } until t <=0
   }

F1::
   timer(14)
   timer(21)
   timer(10)
   timer(22)
   return
   
F2::exitapp

F12::timer(SubStr(A_ThisHotkey,2))

Post Reply

Return to “Ask for Help (v1)”