Page 1 of 1

Pause, STOP, restart.

Posted: 09 Apr 2024, 07:28
by Pippolin

Code: Select all

NumpadDot::
toggle := !toggle
while toggle
loop, 100
{
controlsend, , {a Down}{p Down}{w up}, ahk_exe javaw.exe
sleep 69000
controlsend, , {a Up}{w Down}, ahk_exe javaw.exe
sleep 1000
controlsend, , {w up}{d down}, ahk_exe javaw.exe
sleep 69000
controlsend, , {w down}{d up}, ahk_exe javaw.exe
sleep 1000
}
return
[Mod edit: Added [code][/code] tags, replaced ‘ ‘ ‘. Please use them yourself when posting code!]

How do I add a way to stop restart and terminate this process?

Re: Pause, STOP, restart.

Posted: 09 Apr 2024, 08:21
by V0RT3X
Add this line to your script...

Code: Select all

F3::Reload

Also, please use the code tags. Makes it a lot easier for other to help.
Simply highlight the coding, then press the code button.
image.png
image.png (22.38 KiB) Viewed 186 times

Depending on your board style, it may show the word 'Code'...
image.png
image.png (10.21 KiB) Viewed 186 times

Re: Pause, STOP, restart.

Posted: 11 Apr 2024, 01:20
by Rohwedder
Hallo,
how to avoid long Sleep:

Code: Select all

NumpadDot:: ; on/off
IF !toggle := !toggle
{
	SetTimer, T1, Off
	SetTimer, T2, Off
	Return
}
Counter = 100
T0:
controlsend, , {a Down}{p Down}{w up}, ahk_exe javaw.exe
SetTimer, T1, -69000
Return
T1:
controlsend, , {a Up}{w Down}, ahk_exe javaw.exe
sleep 1000
controlsend, , {w up}{d down}, ahk_exe javaw.exe
SetTimer, T2, -69000
Return
T2:
controlsend, , {w down}{d up}, ahk_exe javaw.exe
sleep 1000
If toggle And --Counter
	Goto, T0
return