Script work for all window instead of one window.

Ask gaming related questions (AHK v1.1 and older)
supawichza40
Posts: 1
Joined: 21 Apr 2021, 22:30

Script work for all window instead of one window.

21 Apr 2021, 22:40

Hi guys :wave: :wave: :wave: , I am really new to this AutoHotkeyCommunity.
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
		

}

}

If there is any problem, I am very sorry in advance.
:crazy: :crazy: :crazy:
User avatar
mikeyww
Posts: 27068
Joined: 09 Sep 2014, 18:38

Re: Script work for all window instead of one window.

22 Apr 2021, 05:08

You can try ControlSend. Some windows will not respond to it.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 53 guests