My goal is to make an AFK bot for a game to make sure I don't get kicked from a server. As it is, if I go AFK for 5 minutes, I get kicked. However, if I have it press the A and D key to move back and forth every few seconds, it's fine. This works well if I am just going AFK to go to the bathroom, or get something to eat, but if I want to go AFK to watch a video on the same computer, problems occur.
So, what I want to do is have the game window get minimized, allowing me to go on YouTube, while still having the A and D keys pressed on the game to ensure I don't get kicked.
I know about the 'Send command to this target' option, and have it set up to send commands to the game window. This works, however if I minimize the game window to start viewing a video, it beeps every time it tries to send a command to the game and doesn't work. I assumed this is because the window is minimized, and when I un-minimized the game window it started working again.
So, I learned that commands can only be sent to non-minimized windows. To go around this limitation, I decided to instead have it move the game window offscreen to where I can't see it, to -5000 x and -5000 y. This allowed the A and D commands to be sent, while I can view YouTube.
The issue with this though is that whenever it sends a command to the game window, it unfocuses the window I am currently looking at. So if I was trying to search for something online, while I am typing into the search bar, it sends a command to the game window, unfocusing google, making me have to click on the search bar again so I can continue typing.
Another problem that happens is while YouTube is in fullscreen, if it sends a command, since it unfocuses YouTube, the taskbar appears on the bottom of the screen, which is really annoying.
So, what is an effective way of sending commands to a game running in the background, while allowing you to continue using other apps?