So, i am brand new to scripting, and AHK. I have done a large amount of reading but im still learning and this is my first attempt.
What I want to accomplish is;
click, jump down set distance, click, jump up.
Then, after the jump up to where action 1 took place, I want it to just repeat these steps indefinitely untill I stop the input,
I did this by making about 1000 Else if... but, I want it to be neat and efficient.
LCtrl::
Gosub , Use
return
Esc::
Action := 0
Jump := 0
return
Use:
If (Action = 0) {
Click Left
Action++
}
Else If (Action = 1) {
Mousemove , 0 , 36 , 0 , R
Action++
}
Else If (Action = 2) {
Click Left
Action++
}
Else If (Action = 3) {
Mousemove , 0 , -36 , 0 , R
Action++
}
Else If (Action = 4) {
Lcrtl:: Esc
} Loop
return
How to endless loop
Re: How to endless loop
What you are looking for are loops; Loop or While-loop
Not sure if this is what you wanted to accomplish, but here is a code from my understanding of your goal;
Also, please use the code tags when posting code.
Not sure if this is what you wanted to accomplish, but here is a code from my understanding of your goal;
Code: Select all
#MaxThreadsPerHotkey, 2
Toggle := 0 ; Initially off
; LCtrl to begin loop. Press again to stop, and so on.
LCtrl::
Toggle := !Toggle
While (Toggle){
Click Left
Mousemove , 0 , 36 , 0 , R
Click Left
Mousemove , 0 , -36 , 0 , R
}
Return
; Esc to stop the input
Esc::
Toggle := 0
Return
Who is online
Users browsing this forum: mstrauss2021, Spawnova, zephyrus2706 and 352 guests