Help with Stopwatch if condition Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Help with Stopwatch if condition

21 Sep 2021, 03:40

Hi everyone !

This is a stopwatch script

Code: Select all

timerm := "44"     ; original value =      "00"
timers := "55"    ; original value =      "00" 
stopped := "0"

Gui, +ToolWindow -Caption +AlwaysOnTop
Gui, Show, NoActivate x1610 y0,uptime
GUi Color ,Yellow
Gui, Font, cRed s14 bold
Gui, Add, Text, x5 y0 w80 h29 vTText, %timerm%:%timers%
Gui, Show, h24 w60, Stopwatch
Settimer, Stopwatch, 1000
RETURN


Stopwatch:
timers += 1
if(timers > 59)
{
	timerm += 1
	timers := "0"
	GuiControl, , TText ,  %timerm%:%timers%
}
if(timers < 10)
{
	GuiControl, , TText ,  %timerm%:0%timers%
}
else
{
	GuiControl, , TText ,  %timerm%:%timers%
}

if(timerm =45 )
{
Run C:\Users\user\Desktop\IMage GUI.ahk
}

/*
Image GUI

Gui, +ToolWindow -Caption +AlwaysOnTop
Gui, Add, Picture,  x0 y0,  Blue Tick.png
gui, font, s10, Verdana
Gui, show, x1585 y0,
Gui, Show, w24 h24,
*/

return
GuiClose:
GuiEscape:
ExitApp
return
In line 32 I have added "if timerm = 45"

How to make it , if timerm =45 and timers = 00

because, as long as timerm shows 45 the "Image GUI" is getting refreshed every second. Once the watch shows 46, it is stable.

Regards.
just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Help with Stopwatch if condition  Topic is solved

21 Sep 2021, 04:05

Code: Select all

if (timerm = 45 ) and (timers = 0)
{
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Re: Help with Stopwatch if condition

21 Sep 2021, 04:09

Thank you. It is working.

I didn't know how to express 2 'if' conditions

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AHK_user and 241 guests