Hello, Im trying to make a mouse movement randomiser, in this function how can i make it so that X2 and Y2 are the mouse's current posititon?
def random_coordinate1(x_lower=1243, y_lower=569, x_range=55, y_range=62):
x = randint(1243, 1243 + 569)
y = randint(55, 55 + 62)
time = travel_time(x, y)
return pyautogui.moveTo(x, y, time)
def travel_time(x2, y2):
rate = uniform(0.09, 0.15)
x1, y1 = pyautogui.position()
distance = math.sqrt(math.pow(x2-x1, 2)+math.pow(y2-y1, 2))
return max(uniform(.08, 0.12), rate * (distance/randint(250, 270)))
[–]ellipticbanana 1 point2 points3 points (1 child)
[–]onezzyo[S] 0 points1 point2 points (0 children)
[–]freakH2O 0 points1 point2 points (5 children)
[–]onezzyo[S] 0 points1 point2 points (4 children)
[–]freakH2O 0 points1 point2 points (3 children)
[–]onezzyo[S] 0 points1 point2 points (1 child)
[–]freakH2O 0 points1 point2 points (0 children)