one click timer

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
noname
Posts: 515
Joined: 19 Nov 2013, 09:15

one click timer

02 Mar 2017, 06:10

Image

I am not sure if it works on all win systems,the alarm sound is a mp3 and the codec must be available ( and speakers).You can if you want change it to a systemsound.
Clicking on a set value will start the countdown and rightclicking will reset the timer.

One default value can be changed in "realtime" the others need changing the inifile ( exit the app first otherwise the change will be overwritten )


Image


The code is too big for posting (exceed posting limit) because all files are embedded.The ahk file is attached (soundfile is included)

update : 17 04 2017 see last post for dropbox download of ahk code
Last edited by noname on 18 Apr 2017, 08:59, edited 3 times in total.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: one click timer

02 Mar 2017, 10:06

Very nice one (again) :thumbup:
Suggestion,

Code: Select all

FormatSeconds(s)
{
	return   s//60 ":" Format("{:.02u}",mod(s,60))
}
to get 0:0x instead of 0:x, if prefered.

Issue, it disables my native scroll wheel functionallity, the scripts scroll wheel functionallity seems fine. I don't think the OnMouseLeave message is recieved. Hence, once status_over_win:=1 it doesn't reset. Quick fix: put SetTimer,OnMouseLeave,-2000 in OnMouseMove().

Thanks for sharing.
User avatar
noname
Posts: 515
Joined: 19 Nov 2013, 09:15

Re: one click timer

02 Mar 2017, 10:48

OnMouseleave is a tricky one but i did not have any problems in this code,sometimes leaving the window at a border and something else is going on would miss it.But on win10 i never saw this problem. Your solution is a nice one :) so i changed the code.Thanks!

Originally i used formattime with gives the leading "0" but i wanted to be able to go beyond 60 minutes when changing the default "1" setting.So my quick try left out the leading zero but actually i liked it more :) so i left it........your solution will help nicely if someone wants it different.
User avatar
noname
Posts: 515
Joined: 19 Nov 2013, 09:15

Re: one click timer

18 Apr 2017, 08:47

On win10 the initial move from center screen to the Gui's stored position caused center screen coordinates to be saved and overwriting the ini file.
This update forces a rewrite after 3sec to store the correct position.

https://www.dropbox.com/s/0gz4x7q73a46z ... r.ahk?dl=1

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 143 guests