-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMouseMovement.py
150 lines (101 loc) · 2.46 KB
/
MouseMovement.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import ClickLocations, scipy, HumanMove
import pyautogui
d = 1
# Moves to reCaptcha.
def moveToReCaptcha ():
x, y = ClickLocations.startReCaptcha ()
HumanMove.moveTo (x, y, duration = d)
# Moves to top-left.
def moveToTopLeft ():
x, y = ClickLocations.topLeft ()
HumanMove.moveTo (x, y, duration = d)
# Moves to top-center.
def moveToTopCenter ():
x, y = ClickLocations.topCenter ()
HumanMove.moveTo (x, y, duration = d)
# Moves to top-right.
def moveToTopRight ():
x, y = ClickLocations.topRight ()
HumanMove.moveTo (x, y, duration = d)
# Moves to middle-left.
def moveToMiddleLeft ():
x, y = ClickLocations.middleLeft ()
HumanMove.moveTo (x, y, duration = d)
# Moves to middle-center.
def moveToMiddleCenter ():
x, y = ClickLocations.middleCenter ()
HumanMove.moveTo (x, y, duration = d)
# Moves to middle-right.
def moveToMiddleRight ():
x, y = ClickLocations.middleRight ()
HumanMove.moveTo (x, y, duration = d)
# Moves to bottom-left.
def moveToBottomLeft ():
x, y = ClickLocations.bottomLeft ()
HumanMove.moveTo (x, y, duration = d)
# Moves to bottom-center.
def moveToBottomCenter ():
x, y = ClickLocations.bottomCenter ()
HumanMove.moveTo (x, y, duration = d)
# Moves to bottom-right.
def moveToBottomRight ():
x, y = ClickLocations.bottomRight ()
HumanMove.moveTo (x, y, duration = d)
# Moves to verify.
def moveToVerify ():
x, y = ClickLocations.verify ()
HumanMove.moveTo (x, y, duration = d)
# Clicks the image.
def imageClick ():
pyautogui.click ()
def whereToMove (moveTo):
if moveTo == 0:
moveToTopLeft ()
elif moveTo == 1:
moveToTopCenter ()
elif moveTo == 2:
moveToTopRight ()
elif moveTo == 3:
moveToMiddleLeft ()
elif moveTo == 4:
moveToMiddleCenter ()
elif moveTo == 5:
moveToMiddleRight ()
elif moveTo == 6:
moveToBottomLeft ()
elif moveTo == 7:
moveToBottomCenter ()
elif moveTo == 8:
moveToBottomRight()
def whereToClick (click):
if click == -1:
moveToVerify ()
imageClick ()
return True
elif click == 0:
moveToTopLeft ()
imageClick ()
elif click == 1:
moveToTopCenter ()
imageClick ()
elif click == 2:
moveToTopRight ()
imageClick ()
elif click == 3:
moveToMiddleLeft ()
imageClick ()
elif click == 4:
moveToMiddleCenter ()
imageClick ()
elif click == 5:
moveToMiddleRight ()
imageClick ()
elif click == 6:
moveToBottomLeft ()
imageClick ()
elif click == 7:
moveToBottomCenter ()
imageClick ()
elif click == 8:
moveToBottomRight()
imageClick ()