From 0b19fa404e8ddb5300c3691e5c65bd60adf69474 Mon Sep 17 00:00:00 2001 From: Anri Date: Wed, 12 Jun 2024 15:59:21 +0200 Subject: [PATCH] Actualiser main.py --- circle.py | 26 -------------------------- main.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 circle.py create mode 100644 main.py diff --git a/circle.py b/circle.py deleted file mode 100644 index 3da3a9b..0000000 --- a/circle.py +++ /dev/null @@ -1,26 +0,0 @@ -from pyautogui import moveTo, size as screen_size, position -from time import sleep -from math import radians, cos, sin - -def circle(radius, base_x, base_y): - previous_x, previous_y = position() - threshold = 50 - - while True: - for angle in range(0, 360, 5): - x = base_x + radius * cos(radians(angle)) - y = base_y + radius * sin(radians(angle)) - - position_x, position_y = position() - if (abs(position_x - previous_x) > threshold or abs(position_y - previous_y) > threshold): - return - - moveTo(x, y) - previous_x, previous_y = x, y - sleep(0.1) - -if __name__ == "__main__": - radius = 100 - center_x, center_y = screen_size()[0] // 2, screen_size()[1] // 2 - - circle(radius, center_x, center_y) diff --git a/main.py b/main.py new file mode 100644 index 0000000..3733153 --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +from pyautogui import press +from time import sleep + +def action(): + while True: + sleep(0.1) + press("win") + sleep(20) + +if __name__ == "__main__": + action()