AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with timers!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
FabianBengtsson



Joined: 14 Nov 2006
Posts: 14

PostPosted: Tue Nov 14, 2006 3:47 pm    Post subject: Help with timers! Reply with quote

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
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Nov 14, 2006 3:53 pm    Post subject: Reply with quote

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 Rolling Eyes
Back to top
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Tue Nov 14, 2006 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FabianBengtsson



Joined: 14 Nov 2006
Posts: 14

PostPosted: Tue Nov 14, 2006 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Nov 14, 2006 4:45 pm    Post subject: Reply with quote

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. Smile
Back to top
FabianBengtsson



Joined: 14 Nov 2006
Posts: 14

PostPosted: Tue Nov 14, 2006 5:09 pm    Post subject: Reply with quote

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. Smile

Sure Razz
Code:
#x::
   SetTimer, 10mWarning, 600000
   Return

   10mWarning:
   SoundPlay, %A_WinDir%\Media\ding.wav
   SetTimer, 10mWarning, Off
Return
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Nov 14, 2006 6:17 pm    Post subject: Reply with quote

Thx. Cool
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group