 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ahk_man
Joined: 20 Jun 2004 Posts: 39
|
Posted: Sun Sep 12, 2004 12:07 am Post subject: help with loop |
|
|
Hi, I want to create a hotkey to start a loop. I want the script to keep on looping until I hit another hotkey then it will stop and let me take control of my system again. Here is my code, but it doesn't work. Note: I want F12 to break out of the loop.
space & F3::
Loop,50
{
If Send={F12}
{
break
}
else
{
BlockInput,on
Send,a,b,c
BlockInput,off
}
} |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sun Sep 12, 2004 12:25 am Post subject: |
|
|
Try this:
| Code: | space & F3::
Loop,50
{
GetKeyState, keycheck, {F12}, P
if keycheck = U
{
break
}
else
{
BlockInput,on
Send,a,b,c
BlockInput,off
}
} |
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Sun Sep 12, 2004 12:27 am Post subject: |
|
|
Shouldn't the above be "if keycheck = D" rather than "if keycheck = U"?
The following topic might also be of interest. It's a very similar solution except that it uses the same hotkey to both start and stop the loop: http://www.autohotkey.com/forum/viewtopic.php?t=784 |
|
| 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
|