| View previous topic :: View next topic |
| Author |
Message |
FabianBengtsson
Joined: 14 Nov 2006 Posts: 14
|
Posted: Tue Nov 14, 2006 3:47 pm Post subject: Help with timers! |
|
|
Hello, and thank you for this wonderful application! I'm trying to do a simple countdown time that plays a warning after 10minutes you have pressed a button. And if you press that button within the time it will reset the timer.
This is what I have come up with so far:
| Code: | #x::
10mWarning:
SoundPlay, %A_WinDir%\Media\ding.wav
Return
#Persistent
SetTimer, 10mWarning, 10000
Return
|
I use 10000ms for testing.
But when I press win+x the sound plays instantly instead of 10s. What am I doing wrong? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Nov 14, 2006 3:53 pm Post subject: |
|
|
| Code: | #Persistent
#x::
SetTimer, 10mWarning, 10000
Return
10mWarning:
SoundPlay, %A_WinDir%\Media\ding.wav
Return
#y::SetTimer, 10mWarning, Off | Not what you've requested I guess  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Tue Nov 14, 2006 3:57 pm Post subject: |
|
|
BoBo, I assume you did it correct. I understood the question the same way. But the #persistent isn't needed, since it will be persistent automatically due to the hotkeys. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
FabianBengtsson
Joined: 14 Nov 2006 Posts: 14
|
Posted: Tue Nov 14, 2006 4:15 pm Post subject: |
|
|
Ok.. Thank you!
what you posted wasn't exactly what I was looking for but it helped me on the right way, and I got working now like wanted. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Nov 14, 2006 4:45 pm Post subject: |
|
|
| Quote: | | and I got working now like wanted | So would you mind to show us your outcome? I' (and toralf too) m(ight be) interested what you've accomplished.  |
|
| Back to top |
|
 |
FabianBengtsson
Joined: 14 Nov 2006 Posts: 14
|
Posted: Tue Nov 14, 2006 5:09 pm Post subject: |
|
|
| BoBo wrote: | | Quote: | | and I got working now like wanted | So would you mind to show us your outcome? I' (and toralf too) m(ight be) interested what you've accomplished.  |
Sure
| Code: | #x::
SetTimer, 10mWarning, 600000
Return
10mWarning:
SoundPlay, %A_WinDir%\Media\ding.wav
SetTimer, 10mWarning, Off
Return |
|
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Nov 14, 2006 6:17 pm Post subject: |
|
|
Thx.  |
|
| Back to top |
|
 |
|