-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoverwatch.ahk
176 lines (154 loc) · 3.97 KB
/
overwatch.ahk
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
; 注意!添加完新方法后,更改最大值
; 之所以这么麻烦,是因为AHK的很多文档都是在扯蛋,官网关于对象和数组的例子都是不能用的。
; 甚至A:=[1,2,3]之类的数组,用A[0]去读都读不到数!!
; "onew"能识别成number,你说气不气人。
; 有的时候对象赋值都特么得读两遍才行。读出来还是不完整的,真特么神了。
overwatch_declare_variable()
{
global
game_func_max := 3 ; 功能编号的最大值
game_func_cur := 0 ; 当前快捷键想要执行的功能编号
}
PrintCurrent(){ ; 打印当前的内容
global
ToolTip, % "【" operation[1] "】 " operation[2] " , " operation[3] "ms", 0, 0
SoundBeep, 300, 300
}
; ------------------------------------------------------------------------------------------------------------------
; ------------------ 循环列表与单独指定
; ------------------------------------------------------------------------------------------------------------------
ChangeGameFunc(){ ; 切换功能编号,方便他人直接调用
global
if (game_func_cur < game_func_max)
game_func_cur := game_func_cur + 1
else
game_func_cur := 1
Switch game_func_cur
{
Case 1:
operation := ["通用英雄", "持续按7", 4500, 100, "7"]
Case 2:
operation := ["通用英雄", "持续按8", 4000, 100, "8"]
Case 3:
operation := ["通用英雄", "持续按9", 4000, 100, "9"]
Default:
operation := ["英雄名称", "效果描述", 重复间隔, 按键间隔, "按键", 按键间隔, "按键", 按键间隔, "按键"]
}
PrintCurrent()
}
SimpleLoopL(){
global
operation := ["通用", "LButton", 100, 100, "{LButton}"]
PrintCurrent()
}
SimpleLoopR(){
global
operation := ["通用", "RButton", 100, 100, "{RButton}"]
PrintCurrent()
}
SimpleLoopM(){
global
operation := ["通用", "MButton", 100, 100, "{MButton}"]
PrintCurrent()
}
SimpleLoopQ(){
global
operation := ["通用", "Q", 100, 100, "q"]
PrintCurrent()
}
SimpleLoopE(){
global
operation := ["通用", "E", 100, 100, "e"]
PrintCurrent()
}
SimpleLoopS(){
global
operation := ["通用", "Shift", 100, 100, "{LShift}"]
PrintCurrent()
}
SimpleLoopV(){
global
operation := ["通用", "XButton1", 100, 100, "{XButton1}"]
PrintCurrent()
}
SimpleLoopX(){
global
operation := ["通用", "X", 500, 100, "x"]
PrintCurrent()
}
MaoMei(){
global
operation := ["毛妹", "盾+大招", 100, 100, "{LShift}", 100, "q"]
PrintCurrent()
}
AnNa(){
global
operation := ["安娜", "睡针药瓶", 100, 100, "{LShift}", 300, "e"]
PrintCurrent()
}
MoYi(){
global
operation := ["莫伊拉", "无限球", 100, 100, "e", 100, "{RButton}"]
PrintCurrent()
}
; --- 其他变种 -----------------------------------------------
AutoLoopL(){
global
operation := ["通用", "LButton", 999, 1, "{LButton}"]
PrintCurrent()
ToggleTimer()
}
; ------------------------------------------------------------------------------------------------------------------
; ------------------ 实际执行与执行开关
; ------------------------------------------------------------------------------------------------------------------
ExecuteOperation(){ ; 执行一次操作命令,把数组里的按键按照间隔全部按一遍 ; 这个傻逼语言,把我逼到这个份上,也是绝了
global
if(operation.length() > 4)
{
delay := operation[4]
char := operation[5]
Sleep, %delay%
Send %char%
}
if(operation.length() > 6)
{
delay := operation[6]
char := operation[7]
Sleep, %delay%
Send %char%
}
if(operation.length() > 8)
{
delay := operation[8]
char := operation[9]
Sleep, %delay%
Send %char%
}
if(operation.length() > 10)
{
delay := operation[10]
char := operation[11]
Sleep, %delay%
Send %char%
}
}
ToggleTimer(){ ; 开关无限循环连点器
global
gap := operation[3]
Toggle := !Toggle
ToolTip
If(Toggle)
{
SetTimer , TheLoop2 , %gap%
SoundBeep, 800, 300
}
Else
{
SetTimer , TheLoop2 , Off
SoundBeep, 400, 300
}
Return
TheLoop2:
ExecuteOperation()
Return
}