| View previous topic :: View next topic |
| Author |
Message |
Looping Guest
|
Posted: Thu Feb 22, 2007 11:03 am Post subject: breaking a loop |
|
|
Hi all,
i'd like this loop to get broken when i press LShift, and then to go on normaly when i release LShift :
| Code: | *RButton::
Loop
{
Send {RButton}
GetKeyState, LoopBreakCheck, RButton, P
if LoopBreakCheck = U
Break
}
return |
i tried to do that but didn't work thanks for the help |
|
| Back to top |
|
 |
Jaytech
Joined: 11 Dec 2006 Posts: 242 Location: Orlando, FL
|
Posted: Thu Feb 22, 2007 5:57 pm Post subject: |
|
|
| Code: | *RButton::
Loop
{
Send {RButton}
GetKeyState LoopBreakCheck, LShift, P
IfEqual LoopBreakCheck, D
Loop
{
GetKeyState LoopBreakCheck, LShift, P
IfEqual LoopBreakCheck, U
BREAK
}
}
return |
|
|
| Back to top |
|
 |
Looping Guest
|
Posted: Thu Feb 22, 2007 9:06 pm Post subject: |
|
|
| thanks but that doesn't work coz now even when i don't push rbutton it gets spammed. rbutton has to be spammed only when i push it, and not to be spammed when i press LShift. |
|
| Back to top |
|
 |
NiJo
Joined: 12 Nov 2005 Posts: 73
|
Posted: Thu Feb 22, 2007 9:13 pm Post subject: Re: breaking a loop |
|
|
| Code: | *RButton::
Loop
{
Send {RButton}
GetKeyState, LoopBreakCheck, RButton, P
if LoopBreakCheck = U
Break
Loop
{
GetKeyState LoopPauseCheck, LShift, P
IfEqual LoopPauseCheck, U
break
}
}
return |
|
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Thu Feb 22, 2007 10:27 pm Post subject: |
|
|
You don't need to check LShift with a GetKeyState:
| Code: | *RButton::
Loop
{
Send {RButton}
GetKeyState, LoopBreakCheck, RButton, P
if LoopBreakCheck = U
break
KeyWait LShift
} |
If you press LShift while the loop is running, it will stop until it's released. |
|
| Back to top |
|
 |
|