andymbody wrote: ↑01 Jan 2024, 13:32
Declare the variables as global, so they are accessible in the function
global x1 := 640, y1 := 355
And just fyi, the
% signs are not required
MouseMove x1, y1
This actually worked for me. Thank you.
Xtra wrote: ↑01 Jan 2024, 13:38
How to pass string variables to function to make it work?
Use function parameters:
Code: Select all
x1 := 640
y1 := 355
$F1::Function(x1,y1)
Function(x1,y1)
{
BlockInput, MouseMove
Send {RButton}
Send {ESC}
Sleep, 50
MouseMove, %x1%, %y1%, 0
Send {click}
Sleep, 50
BlockInput, MouseMoveOff
}
I knew about this method, but how to implemented it when there are several coord positions? e.g. x1, y1; x2, y2; x3, y3 etc...
Also, as i saw in the post written by
andymbody, you can set global param this way: global x1 := 700, y1 := 500, x2 := 600, y2 := 400, x3 := 500, y3 := 300 and so on (in a single row). Is there a way to set global param for strings written in a column? For example:
Code: Select all
Global start
x1 := 700
y1 := 500
x2 := 600
y2 := 400
x3 := 500
y3 := 300
Global end
(it's just an example to get an idea of what i'm looking for, i know it's not right)