-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
executable file
·40 lines (34 loc) · 1.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Created for the Perfect Circle game on https://neal.fun/perfect-circle/
# Coded by Nick Roussis (Neek8044)
# Github: https://github.com/neek8044/Perfect-Circle
# Licensed under Apache License 2.0 (see github ^)
import pyautogui
import math
import time
# Recommended to use 3 as the SPEED factor. You might need to change the RADIUS based on your monitor resolution.
# Both of these settings work well on FHD:1920x1080
SPEED = 3
RADIUS = 494
# If on fullscreen, leave those as they are. If not, change the Y_OFFSET to around 5.6.
# No use to change the X_OFFSET unless you have a double monitor.
X_OFFSET = 0
Y_OFFSET = 0
def getX(t, rad):
return ((pyautogui.size()[0] / 2) + math.cos(t) * rad) + Y_OFFSET
def getY(t, rad):
return ((pyautogui.size()[1] / 2) + math.sin(t) * rad) + X_OFFSET
print('\n--> Place your cursor on the website while on fullscreen.\n\n(Ctrl+C to stop)\n')
try:
time.sleep(3)
for i in range(5):
print(str(5 - i) + ' seconds left.')
time.sleep(1)
except KeyboardInterrupt:
print('Aborted.')
exit()
pyautogui.moveTo(getX(0, RADIUS), getY(0, RADIUS))
pyautogui.mouseDown(button="left")
for i in range(SPEED + 2):
t = i * math.pi / (SPEED / 2)
pyautogui.moveTo(getX(t, RADIUS), getY(t, RADIUS), duration=0)
pyautogui.mouseUp(button='left')