Code: Select all
$x::
MouseClick, Left
sleep, 275
MouseClick, Left
sleep, 355
MouseClick, Left
sleep, 405
send, {r}
sleep, 50
send, {r}
sleep, 240
return
The issue is I'm most often not in a position to complete the sequence, most of the time I need to dodge enemy attacks. When i'm forced to release the hotkey, the script attempts to finish out the current iteration and those extra actions interferes with what I currently want my character to do.
What I want is for the script to abort the current iteration as soon as the hotkey isn't down, then start a new iteration when the hotkey is pressed again.
I tried a few ideas but only this did what I wanted:
Code: Select all
$x::
if (GetKeyState("x","P")){
MouseClick, Left
sleep, 275
}
if (GetKeyState("x","P")){
MouseClick, Left
sleep, 355
}
if (GetKeyState("x","P")){
MouseClick, Left
sleep, 405
}
if (GetKeyState("x","P")){
send, {r}
sleep, 50
}
if (GetKeyState("x","P")){
send, {r}
sleep, 240
}
return
It works the way I want it to, but it's far from elegant.
Would anybody show me a better way to do this?