Script work in an inactive program

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

Script work in an inactive program

09 Mar 2024, 09:43

I have been trying to get my script to work in an inactive window. I have two monitors and one I would like to use my program and it’s script, the other I’d love to use for personal stuff.
Whenever I run the script, if I try to alt tab the program, the script stops, does anyone have any idea how to fix this? This is my code so far:

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
Pause::Exitapp
I am just a beginner to coding, so excuse me if this is a silly question with an easy solution..
Rohwedder
Posts: 7655
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Script work in an inactive program

10 Mar 2024, 01:18

Hallo,
wrong! It is not the script that stops but this inactive javaw.exe.
It simply does not react to the keystrokes of the script. How to fix this? Ask the programmer of javaw.exe.
A workaround would be to activate the target window for each controlsend.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 62 guests