so basically I tried to create a simple script that presses F8 on a specific window(A game window), but somehow when I activate using z hotkey, the game work fine but if I click on another window e.g. chrome, notepad, the script doesn't continue on the game window but change to wherever window that I clicked, is there a way that makes the script only work on this game window instead of following wherever I click so that I can run it in the background and do other work.
here is my code...
Code: Select all
:*:z::
{
WinGet, active_id, ID, A
Loop, 10000
{
send, {F8}
sleep, 2000
}
}