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 loop

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



Joined: 20 Jun 2004
Posts: 39

PostPosted: Sun Sep 12, 2004 12:07 am    Post subject: help with loop Reply with quote

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



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Sun Sep 12, 2004 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Sun Sep 12, 2004 12:27 am    Post subject: Reply with quote

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