02-14-2023, 05:30 PM
Yesterday i was trying to get two mouse positions (saved when the macro clicks) and calculate the distance in pixels between those two clicks.
I tried a few different things but none of them worked. How can i extract the needed int values of x and y?
Everything except "Point" looks fine. When hovering on it, LibreAutomate says:
Error: 'Point' is an ambiguous reference between 'System.Drawing.Point' and 'System.Windows.Point'
If Point is the wrong way, is there a function or class for it, maybe even to calculate the distance?
I tried a few different things but none of them worked. How can i extract the needed int values of x and y?
mouseClicks += 1;
if (mouseClicks == 1) { mousePos = mouse.xy; mouseClicks += 1; };
if (mouseClicks > 1) { mousePos2 = mouse.xy; wait.ms(MouseWait); mouseClicks = 0; };
double distance = Point.Subtract(mousePos, mousePos2).Length;
Everything except "Point" looks fine. When hovering on it, LibreAutomate says:
Error: 'Point' is an ambiguous reference between 'System.Drawing.Point' and 'System.Windows.Point'
If Point is the wrong way, is there a function or class for it, maybe even to calculate the distance?