Jakub Sokołowski 05ad2ebadb fix: remove windows carrige returns from files
Drives me crazy.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-12-01 10:00:56 +03:00

45 lines
960 B
Python
Executable File

import time
import squish
def move(obj: object, x: int, y: int, dx: int, dy: int, step: int, sleep: float = 0):
while True:
if x > dx:
x -= step
if x < x:
x = dx
elif x < dx:
x += step
if x > dx:
x = dx
if y > dy:
y -= step
if y < dy:
y = dy
elif y < dy:
y += step
if y > dy:
y = dy
squish.mouseMove(obj, x, y)
time.sleep(sleep)
if x == dx and y == dy:
break
def press_and_move(
obj,
x: int,
y: int,
dx: int,
dy: int,
mouse: int = squish.MouseButton.LeftButton,
step: int = 1,
sleep: float = 0
):
squish.mouseMove(obj, x, y)
squish.mousePress(obj, x, y, mouse)
move(obj, x, y, dx, dy, step, sleep)
squish.mouseRelease(mouse)
time.sleep(1)