Script Background Topic is solved

Ask gaming related questions (AHK v1.1 and older)
herzog
Posts: 2
Joined: 09 May 2024, 20:23

Script Background

Post by herzog » 09 May 2024, 21:01

Hello everyone, I'm new and I'm learning AHK, I need help running my script in the background of a game.

The game in question is a private server, called "Grand Fantasia Violet".

The command is simple, you just need to press the number 1 on the keyboard.

Code: Select all

F1::

Loop {
        Send {F6 Down}
		Sleep 10
		Send {F6 Up}
		Sleep 300
}

F2::ExitApp
This is the code that I managed to make work in the window with focus, it was necessary to open the script as administrator for it to work.

Code: Select all

F1::

Loop {
        ControlSend,, {1 Down}, ahk_class DJO_CLASS
		Sleep 10
		ControlSend,, {1 Up}, ahk_class DJO_CLASS
		Sleep 300
}

F2::ExitApp
I tried using this code in the background and it didn't work, ControlSend didn't work.
image.png
image.png (23.84 KiB) Viewed 238 times
Here is the window information in Window Spy.
User avatar
boiler
Posts: 17206
Joined: 21 Dec 2014, 02:44

Re: Script Background  Topic is solved

Post by boiler » 09 May 2024, 21:31

ControlSend simply doesn’t work on all windows. It very well could be nothing more than that.

I can’t help but notice in the first script you’re sending the F6 key and you are sending the 1 key in the second. I assume you really did run them using the same keys in both the send and ControlSend versions.
herzog
Posts: 2
Joined: 09 May 2024, 20:23

Re: Script Background

Post by herzog » 09 May 2024, 21:37

It was just an example that I put together, so the keys were changed, but both worked in focus mode
Post Reply

Return to “Gaming Help (v1)”