Run Script While Minimized

Ask gaming related questions (AHK v1.1 and older)
oOLexOo
Posts: 1
Joined: 30 Jun 2019, 14:18

Run Script While Minimized

30 Jun 2019, 14:37

Hoping someone can make this code work while minimized or more or less show me how to make it work. I'm completely new to coding and i scraped this together from some other scrips i've downloaded. It seems to do what i want it to do but it only works on the active screen.

#MaxThreadsPerHotkey 3
Loop
{
Home::
if KeepAltzRunning
{
KeepAltzRunning := false
return
}
; Otherwise:
KeepAltzRunning := true
Loop
{
Send,2
Sleep 200
Send,3
Sleep 250
Send,4
Sleep 250
Send,5
Sleep 250
Send,r
Sleep 1500
if not KeepAltzRunning
break
}

KeepAltzRunning := false
Return
}
User avatar
PipeDreams
Posts: 165
Joined: 19 Dec 2015, 00:20

Re: Run Script While Minimized

10 Jul 2019, 15:34

Try using ControlSend instead of send.
For Example:

Code: Select all

Send,2

would look like:

Code: Select all

SetTitleMatchMode, 2 ;Plce this line at the top of your script
ControlSend, , 2, ahk_exe cmd.exe  ;Send directly to a command prompt window.
Just change the cmd.exe to the game you're plating

Here's working example:

Code: Select all

#SingleInstance Force
SetTitleMatchMode, 2
Run, cmd.exe
a::
ControlSend, , abc, ahk_exe cmd.exe
Return
~Esc::ExitApp

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 107 guests