-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpinScript.py
95 lines (82 loc) · 3.4 KB
/
SpinScript.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import win32api, win32con, keyboard, time, math, random
print('Press Q to quit')
rottype = input('Select rotation type (available types: rot, sin, tan, sinabs, rand): ')
quitBindStr = input('Bind quit key (leave empty for default): ')
pauseBindStr = input('Bind pause key (leave empty for default): ')
quitBind = ''
pauseBind = ''
if quitBindStr != '': quitBind = quitBindStr
else: quitBind = 'q'
if pauseBindStr != '': pauseBind = pauseBindStr[0]
else: pauseBind = 'p'
delay = (float)(input('Enter starting delay: '))
pause = False
if not rottype == 'rand':
multiplier = (float)(input('Set speed: '))
print(f'You have {delay} seconds to alt-tab... Wheeee!')
time.sleep(delay)
if rottype == 'rot':
while not keyboard.is_pressed(quitBind):
if not pause:
mouseX = (int)(time.time()*0.000000001* multiplier)
win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, mouseX, 0, 0, 0)
time.sleep(0.01)
if keyboard.is_pressed(pauseBind):
time.sleep(0.1)
pause = not pause
if keyboard.is_pressed('-'):
multiplier -= 0.1
if keyboard.is_pressed('=') or keyboard.is_pressed('+'):
multiplier += 0.1
elif rottype == 'sin':
while not keyboard.is_pressed(quitBind):
if not pause:
mouseX = (int)(math.sin(time.time())* multiplier)
win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, mouseX, 0, 0, 0)
time.sleep(0.01)
if keyboard.is_pressed(pauseBind):
time.sleep(0.1)
pause = not pause
if keyboard.is_pressed('-'):
multiplier -= 0.1
if keyboard.is_pressed('=') or keyboard.is_pressed('+'):
multiplier += 0.1
elif rottype == 'tan':
while not keyboard.is_pressed(quitBind):
if not pause:
mouseX = (int)(math.tan(time.time())* multiplier)
win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, mouseX, 0, 0, 0)
time.sleep(0.01)
if keyboard.is_pressed(pauseBind):
time.sleep(0.1)
pause = not pause
if keyboard.is_pressed('-'):
multiplier -= 0.1
if keyboard.is_pressed('=') or keyboard.is_pressed('+'):
multiplier += 0.1
elif rottype == 'sinabs':
while not keyboard.is_pressed(quitBind):
if not pause:
mouseX = (int)(math.fabs(math.sin(time.time())* multiplier))
win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, mouseX, 0, 0, 0)
time.sleep(0.01)
if keyboard.is_pressed(pauseBind):
time.sleep(0.1)
pause = not pause
if keyboard.is_pressed('-'):
multiplier -= 0.1
if keyboard.is_pressed('=') or keyboard.is_pressed('+'):
multiplier += 0.1
elif rottype == 'rand':
maxval = (int)(input('Enter maximum possible random value: '))
randdelay = (float)(input('Enter delay between values: '))
print(f'You have {delay} second to alt-tab... Wheeee!')
time.sleep(delay)
while not keyboard.is_pressed(quitBind):
if not pause:
mouseX = (int)(random.randint(0,maxval))
win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, mouseX, 0, 0, 0)
time.sleep(randdelay)
if keyboard.is_pressed(pauseBind):
time.sleep(0.1)
pause = not pause