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 sleep and keywait

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



Joined: 09 Nov 2009
Posts: 92

PostPosted: Wed Dec 16, 2009 12:25 am    Post subject: Help with sleep and keywait Reply with quote

Im trying to do this:
run a loop (if nobody press "up" arrow key after 10 second run notepad and continue the loop)
and in the same time wait for 20 seconds and run explorer (just 1 time)

So, if nobody press "up" after 50 seconds, i'll have 1 explorer opened (20sec) and 5 notepad opened (10sec+10+10+10+10)

I tried to do it with this (with gosub), but it doesn't work

Code:
gosub, order1
sleep 20000
run explorer.exe
return

order1:
Loop
{
    KeyWait, up,D T10
    If(ErrorLevel) {
run notepad.exe
 }
}
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Dec 16, 2009 1:06 am    Post subject: Reply with quote

why are u keep making new threads on the same script??
Code:
settimer, a, 10000
settimer, b, 20000
up::
settimer, a, off
settimer, b, off
settimer, a, 10000
settimer, b, 20000
return

a:
run, notepad.exe
return

b:
x++
if x = 1
run, explorer.exe
return
 
Back to top
alexisfch



Joined: 09 Nov 2009
Posts: 92

PostPosted: Wed Dec 16, 2009 1:45 am    Post subject: Reply with quote

in your script if I keep pressed "up" arrow key, nothing happens, I mean will not run notepad and explorer.

Anonymous wrote:
why are u keep making new threads on the same script??
Code:
settimer, a, 10000
settimer, b, 20000
up::
settimer, a, off
settimer, b, off
settimer, a, 10000
settimer, b, 20000
return

a:
run, notepad.exe
return

b:
x++
if x = 1
run, explorer.exe
return
 
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Dec 16, 2009 5:38 am    Post subject: Reply with quote

why would pressing up opens anything?
Quote:
Im trying to do this:
run a loop (if nobody press "up" arrow key after 10 second run notepad and continue the loop)
and in the same time wait for 20 seconds and run explorer (just 1 time)

So, if nobody press "up" after 50 seconds, i'll have 1 explorer opened (20sec) and 5 notepad opened (10sec+10+10+10+10)

u only said pressing up would hold the Run for another 10/20 seconds

if u want to Run something when up is pressed, u can put Run whatever in the up hotkey
Back to top
Display posts from previous:   
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