Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Store two mouse.xy positions in Variables to calculate
#1
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?


Code:
Copy      Help
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?


Messages In This Thread
Store two mouse.xy positions in Variables to calculate - by Remotehorst23 - 02-14-2023, 05:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)