-
Notifications
You must be signed in to change notification settings - Fork 13
/
realm.ahk
319 lines (288 loc) · 5.84 KB
/
realm.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetKeyDelay 0
SetMouseDelay 0
SetTitleMatchMode 2
Suspend on
GroupAdd rotmg, Realm of the Mad God
GroupAdd rotmg, realmofthemadgod
GroupAdd rotmg, AGCLoader
GroupAdd rotmg, Play Realm of the Mad God
GroupAdd rotmg, SwiffOutRunner
GroupAdd rotmg, Adobe Flash Player 10
GroupAdd rotmg, Adobe Flash Player 11
GroupAdd rotmg, fla
WinNotActive()
WinActive()
{
Suspend Off
WinWaitNotActive ahk_group rotmg
{
WinNotActive()
}
}
WinNotActive()
{
Suspend on
WinWaitActive ahk_group rotmg
{
WinActive()
}
}
; teleports to tptarget (set with ^n)
RButton::
clipboard = /teleport %tptarget%
goto ek
; sends rclick when ctrl+rclick is sent to get the flash context menu
^+RButton::
Click right
Return
; sets clipboard and sends off to ek/tk (function to send clipboard using enter/tab key)
F1::
clipboard = thanks.
goto ek
F4::
clipboard = yes.
goto tk
F5::
clipboard = no.
goto tk
F6::
clipboard = ok.
goto tk
Numpad2::
clipboard = :)
goto tk
`::
clipboard = /pause
goto ek
^t::
clipboard = /nexustutorial
goto ek
; ignores the person that shows up when you press tab (last person that /tell you)
Numpad1::
clipboard := "/ignore "
Blockinput, on
Send {tab}{home}^+{Right}^v{enter}
Blockinput, off
Return
; set a teleport target
^n::InputBox, tptarget, Teleport target, Please enter a person to teleport to:
; teleport to the target set with ^n
^f::
clipboard = /teleport %tptarget%
goto ek
; set a trading message
F7::InputBox, tradingmsg, Trading message, Please enter a trading message:
; send trading message
F8::
if endoftrading = 0
{
clipboard = /yell %tradingmsg%
endoftrading = 1
}
else
{
clipboard = /yell %tradingmsg%!
endoftrading = 0
}
goto ek
; double click on slot 7 in the inventory (0, 1, 2, 3 in the bottom row)
xbutton2::
slot = 2
goto swap
xbutton1::
slot = 3
goto swap
; scroll the chat log with the default in game keybinds
+WheelUp::Send {PgUp}
+WheelDown::Send {PgDn}
; convert /tp to /teleport in the game chat
:*:/tp::
clipboard = /teleport
Blockinput, on
Send ^a
Send ^v
Send {space}
Blockinput, off
Return
; go to the character select
^r::
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
Send {Esc}
Loop
{
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\charsel.png
if ErrorLevel = 1
continue
else
break
}
MouseClick, Left, imageLocX, imageLocY, 1
MouseClick, Left, imageLocX-240, imageLocY, 1 ; back to home is bugged
MouseMove, mousePosX, mousePosY
Return
; go to the server select screen
+^r::
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
Send {Esc}
Loop
{
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\charsel.png
if ErrorLevel = 1
continue
else
break
}
MouseClick, Left, imageLocX, imageLocY, 1
MouseClick, Left, imageLocX-240, imageLocY, 1 ; back to home is bugged
Loop
{
ImageSearch, imageLocXa, imageLocYb, 0, 0, %winSizeX%, %winSizeY%, img\coin.png
if ErrorLevel = 1
continue
else
break
}
MouseClick, Left, imageLocX-328, imageLocY+20, 1
MouseClick, Left, imageLocX-328, imageLocY+20, 1
MouseMove, mousePosX, mousePosY
Return
; select all 8 slots while trading
^a::
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\trade.png
Xinc = 0
Yinc = 250
Loop 2
{
Loop 4
{
MouseClick, Left, imageLocX+Xinc, imageLocY-Yinc, 1
Xinc += 44
}
Xinc = 0
Yinc -= 50
}
MouseMove, mousePosX, mousePosY
return
; pick up all 8 slots
^w::
SendMode Event
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\searchimage.png
imageLocX += 25
imageLocY += 55
Xinc = 0
Yinc = 0
Loop 2
{
Loop 4
{
MouseMove, imageLocX + Xinc, imageLocY + Yinc
SendEvent {LButton Down}
MouseMove, imageLocX + Xinc + 3, imageLocY + Yinc + 3
Sleep 260
MouseMove, imageLocX + Xinc, imageLocY + Yinc - 125
SendEvent {LButton Up}
Sleep 260
Xinc += 44
}
Xinc = 0
Yinc += 50
}
MouseMove, mousePosX, mousePosY
Return
; drop all items in chest
^d::
SendMode Event
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\searchimage.png
imageLocX += 25
imageLocY -= 70
MouseMove, imageLocX, imageLocY
Xinc = 0
Yinc = 0
Loop 2
{
Loop 4
{
MouseMove, imageLocX + Xinc, imageLocY + Yinc
SendEvent {LButton Down}
MouseMove, imageLocX + Xinc + 3, imageLocY + Yinc + 3
Sleep 260
MouseMove, imageLocX + Xinc, imageLocY + Yinc + 125
SendEvent {LButton Up}
Sleep 260
Xinc += 44
}
Xinc = 0
Yinc += 50
}
MouseMove, mousePosX, mousePosY
Return
; toggle chat
^F1::
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
Send {Esc}
Loop
{
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\charsel.png
if ErrorLevel = 1
continue
else
break
}
MouseClick, Left, imagelocx-400, imagelocy-460
MouseClick, Left, imagelocx - 560, imagelocy-240
Send {Esc}
Return
; toggle trade request panel
^F2::
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
Send {Esc}
Loop
{
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\charsel.png
if ErrorLevel = 1
continue
else
break
}
MouseClick, Left, imagelocx-240, imagelocy-470
Mouseclick, Left, imagelocx-560, imagelocy-280
Send {Esc}
Return
; sends clipboard to the chat using the enter key
ek:
Blockinput, on
Send {Enter}
Send ^v
Send {Enter}
Blockinput, off
Return
; sends clipboard to the chat using the tab key
tk:
Blockinput, on
Send {Tab}
Send ^v
Send {Enter}
Blockinput, off
Return
; swap function
swap:
MouseGetPos, mousePosX, mousePosY
WinGetPos, , , winSizeX, winSizeY, A
ImageSearch, imageLocX, imageLocY, 0, 0, %winSizeX%, %winSizeY%, img\searchimage.png
MouseClick, Left, imageLocX + (44 * slot) + 30, imageLocY - 20, 2
MouseMove, mousePosX, mousePosY
Return