Ask gaming related questions
Brillian
Posts: 17
Joined: 06 Nov 2017, 11:45
Facebook: http://fb.com/brillianclaridadescallo

04 Apr 2019, 02:42

Hello everyone, can somebody please help me with my problem in sending keystrokes to a specific window and be able to do something else while the AHK is active? Been trying to do this for the last 2 years I think. :cry:

Here is my code:
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}

DetectHiddenWindows, on
SetTitleMatchMode, 2
WinGet, Rohanid, List, Rohan

Loop
{
ControlSend,, {1}, ahk_id %Rohanid1%
Sleep, 300
ControlSend,, {2}, ahk_id %Rohanid1%
Sleep, 300
ControlSend,, {3}, ahk_id %Rohanid1%
Sleep, 300
ControlSend,, {4}, ahk_id %Rohanid1%
Sleep, 300
ControlSend,, {5}, ahk_id %Rohanid1%
Sleep, 300
}

#If, A_IsPaused
Home::
Suspend
Pause
Return
#If
Home::
Suspend
Pause
Return
Basically I just want to continuously press 1 2 3 4 5. It does not seem to work tho. Tried it with Notepad and it's working. I don't know what's the problem.

Here is the guide that I used: https://autohotkey.com/board/topic/71838-solved-run-a-script-for-a-program-in-the-background/

Unfortunately, he did not post the final code that he came up with, so I don't have a clue on which part of my code is wrong.

Return to “Gaming”

Who is online

Users browsing this forum: phibbus and 58 guests