Am I dumb? What's wrong with this one line for an auto hotkey script

Viewed 180

I'm trying to make this very simple script auto-click for Roblox, but when I run the program it says "parameter #3 invalid, specifically ahk_pid 13636" despite this being the correct window title being displayed in Window Spy.

F7::
Loop, 5 ControlClick, x400 y375, ahk_pid 13636, Roblox, Left, 1

F8:: ExitApp

SciTE Debug Message

1 Answers

You're trying to pass in all those arguments to the loop command, as opposed using the ControlClick command at any point. And you're also using the WinText parameter incorrectly (you just want to ignore that parameter altogether).

This would be the correct way:
({ } are optional for one line statements)

F7::
    Loop, 5
    {
        ControlClick, x400 y375, ahk_pid 13636, , , , NA
    }
return

F8:: ExitApp

I also added in the NA option because it's recommended if it works for the desired window.
If the option would cause it not to work, remove it.

Also remember that control clicking is always pretty much a hit or miss.
If it works, great, if not, don't be surprised.

Related