Page 1 of 1
Pause function not working properly as the script keeps running
Posted: 22 Jun 2021, 21:07
by sadlulu
I wrote a ahk script, I want to pause the script when I press F7. Yet the script keeps on running and w and left click keeps getting pressed.
How can I modify so pressing f7 pauses the script and f8 resumes the script? Thanks
Code: Select all
F8::
Loop
send {w down}{click down}
return
F7::pause
esc:: ExitApp
Re: Pause function not working properly as the script keeps running
Posted: 22 Jun 2021, 21:17
by mikeyww
Code: Select all
F7::SetTimer, Go, Off
F8::SetTimer, Go, 50
Go:
Send w
Click
Return
Re: Pause function not working properly as the script keeps running
Posted: 22 Jun 2021, 21:33
by sadlulu
mikeyww wrote: ↑22 Jun 2021, 21:17
Code: Select all
F7::SetTimer, Go, Off
F8::SetTimer, Go, 50
Go:
Send w
Click
Return
Thanks for the quick reply.
Sorry for being unclear about the question. I want to hold the left click. I think your script just clicks every 50 millisecond.
I tried to look up on google and ppl said toggle is the way. However idk why it's not working.
Re: Pause function not working properly as the script keeps running Topic is solved
Posted: 23 Jun 2021, 00:48
by aifritz
Something like this?
Code: Select all
F8::send {w down}{click down}
F7::send {w up}{click up}
Re: Pause function not working properly as the script keeps running
Posted: 23 Jun 2021, 00:56
by Rohwedder
Hallo,
or:
Code: Select all
F8::SetTimer, F8 Up, 50
F8 Up::Send, {w down}{click down}
F7::SetTimer, F8 Up, Off
F7 Up::Send, {w up}{click up}
The key downs are sent every 50ms.
Re: Pause function not working properly as the script keeps running
Posted: 23 Jun 2021, 14:20
by sadlulu
Both aifritz and Rohwedder's functions work.
I am not sure about the difference between pausing and not pausing though. I experimented with both and found no difference in pratical