ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

simple timer

<< < (2/5) > >>

belkira:
Im on my way out of work now. I will try to post clearer instructions a little later tonight.

dbarton:
Im on my way out of work now. I will try to post clearer instructions a little later tonight.
-belkira (September 12, 2008, 06:04 PM)
--- End quote ---

I rewrote it in simpler terms to try and break it down for me, and this way make sense to me so far...
Still, I don't see how I can add a min by min countdown...

;win 2
#2::
SplashTextOn, 250, 20,, preset for 120 mins
sleep, 1000
SplashTextOff

SetTimer, Message, 7200000
return

Message:
SetTimer, Message, Off
MsgBox ,64 ,dTIMER, 120 minutes is up!
return

belkira:
You may also want to look at this:

http://www.autohotkey.com/forum/viewtopic.php?t=35135&highlight=countdown+timer

As for my script, I think you got it but I will break it down in any case.

The way I envisioned you using it was thus:
Copy/Paste the code into a file, called say Timer.ahk. Put this file someplace out of the way, maybe the root of the C:\ drive.
Right click on this file and select Send To| Desktop (Create Shortcut).
Now right click on this file (the shortcut) go to Properties and put the number of minutes in after the Target line, i.e.:
"C:\Documents and Settings\User\Desktop\Timer.ahk" 120

This way you can create multiple timers all running at once if need be.
I will look into the countdown thing, I was thinking you only wanted something
that would tell you after a certain amount of time had passed.

The program I linked to at the beginning of this post is a countdown timer, but I don't know if
it is what you want.

Below I have explained the script. I hope it fills in any gaps I may have left.
#persistent ; Used to keep the application running long enough to use the timer
#singleinstance off ; So you can have multiple instances running
%1% := 60 * (%1% * 1000) ; Ok so this is where it gets fun, %1% is the number you give to the program (in minutes). SetTimer uses milliseconds so we have to convert that to seconds, then from there to minutes.

SetTimer, Message, %1% ; Here we tell the timer to wait for X amount of time then run the commands at the given label, in this case Message
return


Message:
SetTimer, Message, Off ; Here I turn the timer off so it doesn't keep running
msgbox Done! ; This is what happens when the timer reaches its mark.
ExitApp

--- End quote ---
-Belkira

dbarton:
Much appreciated.

I never thought of using AHK, but it seems to have worked out.. Got a version running by patches a few peoples code togther. Thanks!

belkira:
Did you get the countdown part working also? If so I would like to see that part of the code to see how it was done.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version