Created
September 2, 2024 18:50
-
-
Save Gavriel770U/d0db5f6883868626cf0705f775ac5725 to your computer and use it in GitHub Desktop.
Neal's circle code for perfect circle (Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynput.mouse import Button, Controller | |
import time | |
def main() -> None: | |
mouse = Controller() | |
mouse.press(Button.left) | |
print("Left mouse button pressed.") | |
time.sleep(12) | |
mouse.release(Button.left) | |
print("Left mouse button released.") | |
if __name__ == "__main__": | |
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install pyautogui | |
pip install pynput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui | |
import time | |
import math | |
import subprocess | |
def main() -> None: | |
for i in range(5, 0, -1): | |
print(i) | |
time.sleep(1) | |
w, h = pyautogui.size() | |
print("Drawing circle...") | |
cx, cy = w / 2, h / 2 | |
r = 250 | |
sx = cx + r | |
sy = cy | |
pyautogui.moveTo(sx, sy) | |
subprocess.Popen(['python', './holdmouse.py']) | |
j = 6 | |
for i in range(-j*2, 360+j, j): | |
x = cx + r * math.cos(math.radians(i)) | |
y = cy + r * math.sin(math.radians(i)) | |
pyautogui.moveTo(x, y) | |
if __name__ == "__main__": | |
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python main.py | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment