Need basic click command help
-
- Posts: 5
- Joined: 21 Jun 2018, 09:26
Need basic click command help
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.
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
-
- Posts: 5
- Joined: 21 Jun 2018, 09:26
Re: Need basic click command help
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?
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?