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 

simple timer/counter script?

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



Joined: 01 Jun 2005
Posts: 147

PostPosted: Fri Dec 14, 2007 12:11 am    Post subject: simple timer/counter script? Reply with quote

Hi,

I'm searching for a simple script that I could use so that I don't have to come up with one from scratch. What it should do - in lay terms - is this:

perform action 1 for x seconds
then, perform action 2 for x seconds
repeat 10 times

I used the search but couldn't find something like that (yeah, I know, it's probably bloody simple to code, but I never needed something like that).
_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Dec 14, 2007 1:32 pm    Post subject: Re: simple timer/counter script? Reply with quote

brotherS wrote:
I know, it's probably bloody simple to code

You are right.It is so simple that I can't imagine wich kind of help you need.
Back to top
Ace_NoOne



Joined: 10 Oct 2005
Posts: 333
Location: Germany

PostPosted: Fri Dec 14, 2007 2:46 pm    Post subject: Reply with quote

Here's a suggestion:
Code:
Loop, 10 {
   foo()
   Sleep, %delay1%
   bar()
   Sleep, %delay2%
}

Now, that doesn't actually perform the respective action for x seconds - for that you'd probably use SetTimer with some kinda boolean variable to initiate the transition.
_________________
Improving my world, one script at a time.
Join the AutoHotkey IRC channel: irc.freenode.net #autohotkey
Back to top
View user's profile Send private message
brotherS



Joined: 01 Jun 2005
Posts: 147

PostPosted: Fri Dec 14, 2007 6:03 pm    Post subject: Reply with quote

Ace_NoOne wrote:
Here's a suggestion:
Code:
Loop, 10 {
   foo()
   Sleep, %delay1%
   bar()
   Sleep, %delay2%
}

Now, that doesn't actually perform the respective action for x seconds - for that you'd probably use SetTimer with some kinda boolean variable to initiate the transition.

Right, totally forgot about that... thanks a lot!
_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.
Back to top
View user's profile Send private message
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