Pause, STOP, restart.

Ask gaming related questions (AHK v1.1 and older)
Pippolin
Posts: 2
Joined: 29 Feb 2024, 15:55

Pause, STOP, restart.

09 Apr 2024, 07:28

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?
User avatar
V0RT3X
Posts: 236
Joined: 20 May 2023, 21:59
Contact:

Re: Pause, STOP, restart.

09 Apr 2024, 08:21

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 107 times

Depending on your board style, it may show the word 'Code'...
image.png
image.png (10.21 KiB) Viewed 107 times
Rohwedder
Posts: 7659
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Pause, STOP, restart.

11 Apr 2024, 01:20

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

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 50 guests