Make script run on a specific window so I can do other stuff with my script active

Ask gaming related questions (AHK v1.1 and older)
CarsonBDot
Posts: 1
Joined: 26 Jun 2022, 18:47

Make script run on a specific window so I can do other stuff with my script active

Post by CarsonBDot » 26 Jun 2022, 18:53

Ok so say I want to automate a game and play another or maybe I want to automate a game and watch a show or something, how would I do this? I haven't worked on any code for this but I do have some code in mind that i'd want automated just to see if it works.

Code: Select all

e::
	toggle:=!toggle
	While toggle{
	  Send {J}
	  Sleep 2000
	}
Return

[Mod action: Topic moved to “Gaming”]

User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Make script run on a specific window so I can do other stuff with my script active

Post by mikeyww » 26 Jun 2022, 20:24

Welcome to this AutoHotkey forum!

You can WinActivate the window before Send, or try :arrow: ControlSend. The forum has many, many, many examples, or see examples in the documentation.

Post Reply

Return to “Gaming Help (v1)”