-
Notifications
You must be signed in to change notification settings - Fork 0
/
actions.py
132 lines (111 loc) · 2.4 KB
/
actions.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
from panel import clear, show, hide, draw, getboundries
from mouse import getmode, setmode, mousemove, mousepress, mouserelease, \
mouseclick
from recipes import log2increase, log2decrease
#-------------------------------------------------------------------72->
# global state
x, y = (0, 0, 0), (0, 0, 0)
#-------------------------------------------------------------------72->
def mouseafter():
draw(x, y)
#-------------------------------------------------------------------72->
def center():
global x, y
w, h = getboundries()
w -= 1; h -= 1
x = (0, w//2, w)
y = (0, h//2, h)
def print_location():
print(x)
def unassigned():
debug = True
if debug:
print("doom!")
def left_down():
global x, y, log
x = log2decrease(x)
y = log2increase(y)
mousemove(x, y)
mouseafter()
print("left down")
def down():
global x, y, log
y = log2increase(y)
mousemove(x, y)
mouseafter()
print("down")
def right_down():
global x, y, log
x = log2increase(x)
y = log2increase(y)
mousemove(x, y)
mouseafter()
print("right down")
def left():
global x, y, log
x = log2decrease(x)
mousemove(x, y)
mouseafter()
print("left")
def set_origin():
global x, y
w, h = getboundries()
x = (0, x[1], w)
y = (0, y[1], h)
print("set origin")
def right():
global x, y, log
x = log2increase(x)
mousemove(x, y)
mouseafter()
print("right")
def left_up():
global x, y, log
x = log2decrease(x)
y = log2decrease(y)
mousemove(x, y)
mouseafter()
print("left up")
def up():
global x, y, log
y = log2decrease(y)
mousemove(x, y)
mouseafter()
print("up")
def right_up():
global x, y, log
x = log2increase(x)
y = log2decrease(y)
mousemove(x, y)
mouseafter()
print("right up")
def click():
hide()
mouseclick()
def hold_click():
hide()
mousepress()
show()
def release_click():
hide()
mouserelease()
def set_left():
global mode
mode = 0
print("mode is set to "+str(getmode()))
def set_middle():
global mode
mode = 2
print("mode is set to "+str(getmode()))
def set_right():
global mode
mode = 1
print("mode is set to "+str(getmode()))
def reset_center():
print("reset to center")
global x, y
# center x, y
center()
clear()
mousemove(x, y)
mouseafter()