 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
alexisfch
Joined: 09 Nov 2009 Posts: 92
|
Posted: Wed Dec 16, 2009 12:25 am Post subject: Help with sleep and keywait |
|
|
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 |
|
 |
Guest
|
Posted: Wed Dec 16, 2009 1:06 am Post subject: |
|
|
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
|
Posted: Wed Dec 16, 2009 1:45 am Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Wed Dec 16, 2009 5:38 am Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|