Here is my code:
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.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
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.