Hello. I'm begginer with hotkeys.
I'm looking to make script ,that clicks in multiple cordinates,by one click ..
For example, I press f1 ,and its click here 1292,372 here 1146,336 and here 1292,372 .
Thanks everyone for help !
Multiple cordinates click on one hotkey.
-
- Posts: 1
- Joined: 11 Sep 2018, 12:11
Re: Multiple cordinates click on one hotkey.
Code: Select all
#SingleInstance, Force
arrCoord := []
arrCoord[1] := "1292,372"
arrCoord[2] := "1146,336"
arrCoord[3] := "1292,372"
F1::
For K, V In arrCoord {
C := InStr(V, ",")
X := SubStr(V, 1, C - 1)
Y := SubStr(V, C + 1)
Click, X, Y
}
return
Re: Multiple cordinates click on one hotkey.
Code: Select all
CoordMode Mouse
Coords := [[1292, 372]
, [1146, 336]
, [1292, 372]]
F1::
for each, Pair in Coords
{
x := Pair[1]
y := Pair[2]
Click, %x%, %y%
}
return
Re: Multiple cordinates click on one hotkey.
Code: Select all
F1::
Click, 1292, 372
Click, 1146, 336
Click, 1292, 372
return
Re: Multiple cordinates click on one hotkey.
I wrote a little function that you might benefit from. It sends a click to the coordinates you specify as x and y and returns your mouse to the same location it was in when the code was executed.
Your examples would look like this:
fn_click(1292, 372)
fn_click(1146, 336)
fn_click(1292, 372)
Code: Select all
fn_click(x,y)
{
CoordMode, mouse, Screen
MouseGetPos, xpos, ypos
Click, Left, %x%, %y%, 1
MouseMove, %xpos%, %ypos%, 0
Return
}
Your examples would look like this:
fn_click(1292, 372)
fn_click(1146, 336)
fn_click(1292, 372)
Who is online
Users browsing this forum: Google [Bot], jameswrightesq and 427 guests