-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
53 lines (40 loc) · 1.83 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
41
42
43
44
45
46
47
48
49
50
51
52
import pyautogui
import time
if __name__ == '__main__':
print("Starting mouse wiggler...")
print("Press 'ctrl+c' to exit")
# Getting screen size
screenWidth, screenHeight = pyautogui.size()
# This script will move the mouse to these points at the set time intervals
# (0,0) (X, 0)
# +----------------------------------------------------+
# | TL(25%, 25%) TR(75%, 25%) |
# | |
# | |
# | |
# | BL(25%, 75% BR(75%, 75%) |
# +----------------------------------------------------+
# (0, Y) (X,Y)
# Denoting the position on the screen to move the mouse to
pos_TL = [screenWidth * 0.25, screenHeight * 0.25]
pos_TR = [screenWidth * 0.75, screenHeight * 0.25]
pos_BL = [screenWidth * 0.25, screenHeight * 0.75]
pos_BR = [screenWidth * 0.75, screenHeight * 0.75]
# Time between mouse moves (seconds)
WAIT_TIME = 5
# Time for the mouse to travel from point to point (seconds)
MOUSE_SPEED = 2
# Looping program till keyboard interrupt
try:
while True:
pyautogui.moveTo(pos_TL[0], pos_TL[1], MOUSE_SPEED)
time.sleep(WAIT_TIME)
pyautogui.moveTo(pos_TR[0], pos_TR[1], MOUSE_SPEED)
time.sleep(WAIT_TIME)
pyautogui.moveTo(pos_BL[0], pos_BL[1], MOUSE_SPEED)
time.sleep(WAIT_TIME)
pyautogui.moveTo(pos_BR[0], pos_BL[1], MOUSE_SPEED)
time.sleep(WAIT_TIME)
pyautogui.press('shift')
except KeyboardInterrupt:
print("\nClosing mouse wiggler...")