Page 1 of 1

Need basic click command help

Posted: 21 Jun 2018, 09:31
by Nelson3494
I'm new to AHK and need help making some basic code to click somewhere. I'd like to be able to program a button on my keyboard or mouse to click on certain coordinates on the screen, and then maybe return the mouse to where it was before I did the command. I dont know what the coordinates are of where to click and I saw an old video where you could record you doing something and it spit out code but can't figure out how to do that either. Please help. Thanks.

Re: Need basic click command help

Posted: 21 Jun 2018, 11:24
by AHKStudent

Re: Need basic click command help

Posted: 21 Jun 2018, 11:48
by Nelson3494
So that works and I was able to record but it gave me a code that looks like this...

OriginWin(X, Y, -8, -8, "ahk_class TFormMainTOSM", "", "")
;--
Click(X+1768, Y+159, "L")
;--
Click(X+826, Y+356, "L")
;--
Click(X+997, Y+349, "L")
;--
Click(X+1756, Y+257, "L")

What do I do with it? I tried to put it in a new AHK script and ran it and it gave me an error and I tried to put ^r:: in front so I could use control r to activate it but it still didn't go. How do I make it repeat what I recorded on command?