Pause function not working properly as the script keeps running Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sadlulu
Posts: 3
Joined: 22 Jun 2021, 21:02

Pause function not working properly as the script keeps running

22 Jun 2021, 21:07

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
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Pause function not working properly as the script keeps running

22 Jun 2021, 21:17

Code: Select all

F7::SetTimer, Go, Off
F8::SetTimer, Go, 50
Go:
Send w
Click
Return
sadlulu
Posts: 3
Joined: 22 Jun 2021, 21:02

Re: Pause function not working properly as the script keeps running

22 Jun 2021, 21:33

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.
aifritz
Posts: 301
Joined: 29 Jul 2018, 11:30
Location: Germany

Re: Pause function not working properly as the script keeps running  Topic is solved

23 Jun 2021, 00:48

Something like this?

Code: Select all

F8::send {w down}{click down}
F7::send {w up}{click up}
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Pause function not working properly as the script keeps running

23 Jun 2021, 00:56

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.
sadlulu
Posts: 3
Joined: 22 Jun 2021, 21:02

Re: Pause function not working properly as the script keeps running

23 Jun 2021, 14:20

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: wilkster and 324 guests