Timer per Tooltip Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

UnReALiTyy
Posts: 45
Joined: 06 Jun 2017, 11:38

Timer per Tooltip

22 Apr 2018, 09:19

Hey leute vielleicht habt ihr eine Idee wie ich einen 4 Minütigen timer schreiben kann der mir am liebsten als tooltip angezeigt wird, sprich so...

Tooltip, 04:00, 0, 0
Tooltip, 03:59, 0, 0
Tooltip, 03:58, 0, 0
Tooltip, 03:57, 0, 0
Tooltip, 03:56, 0, 0
Tooltip, 03:55, 0, 0

und sorry für die mangelnde erklärung :oops:
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Timer per Tooltip  Topic is solved

22 Apr 2018, 09:56

Code: Select all

tooltip := {"x" : (A_ScreenWidth // 2), "y" : (A_ScreenHeight // 2)}
duration := 15 ; in seconds
SetTimer, Countdown, 1000

Countdown:
{
	if !(duration) {
		ToolTip
		SetTimer, , Off
		return
	}

	duration--

	minutes := SubStr("0" . (duration // 60), -1)
	seconds := SubStr("0" . (Mod(duration, 60)), -1)
	ToolTip, % minutes . ":" . seconds, % tooltip.x, % tooltip.y
return
}

Esc::ExitApp, 0
UnReALiTyy
Posts: 45
Joined: 06 Jun 2017, 11:38

Re: Timer per Tooltip

22 Apr 2018, 10:28

Danke man mega genau das was ich suchte :superhappy: :superhappy: :superhappy:
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Timer per Tooltip

30 Apr 2018, 11:00

what flickering

Image
UnReALiTyy
Posts: 45
Joined: 06 Jun 2017, 11:38

Re: Timer per Tooltip

15 May 2018, 10:44

swagfag wrote:what flickering

Image
do you have an idea how I let the timer show the hours when the timer is over 1 hour?
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Timer per Tooltip

15 May 2018, 16:49

Code: Select all

tooltip := {"x" : (A_ScreenWidth // 2), "y" : (A_ScreenHeight // 2)}
duration := 3676 ; in seconds
SetTimer, Countdown, 1000

Countdown:
{
	if !(duration) {
		ToolTip
		SetTimer, , Off
		return
	}

	duration--

	hours := SubStr("0" . (duration // 3600), -1)
	minutes := SubStr("0" . ((duration - hours * 3600) // 60), -1)
	seconds := SubStr("0" . (Mod(duration, 60)), -1)
	ToolTip, % Format("{}:{}:{}", hours, minutes, seconds), % tooltip.x, % tooltip.y
return
}

Esc::ExitApp, 0
UnReALiTyy
Posts: 45
Joined: 06 Jun 2017, 11:38

Re: Timer per Tooltip

16 May 2018, 10:53

best man, thank you! :bravo: :bravo:
but why this tooltip

Code: Select all

ToolTip, % Format("{}:{}:{}", hours, minutes, seconds), 0, 0
and not like before?

Code: Select all

ToolTip, % hours ":" minutes ":" seconds, 0, 0
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Timer per Tooltip

16 May 2018, 11:00

It's effectively the same tooltip, just written differently
UnReALiTyy
Posts: 45
Joined: 06 Jun 2017, 11:38

Re: Timer per Tooltip

16 May 2018, 11:12

ok that's fine thanks

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 1 guest