-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathluxon.ahk
588 lines (487 loc) · 9.62 KB
/
luxon.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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <[email protected]>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#Persistent
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
WinWait, Guild Wars,
IfWinNotActive, Guild Wars, , WinActivate, Guild Wars,
WinWaitActive, Guild Wars,
Send u
Sleep 500
Send {wheelup 5}
Send u
Sleep 500
;FileDelete, threshfail\*.*
FileDelete, debug.log
cashExpected := 0
factionExpected := 0
OnExit, ExitSub
Loop
{
;----
;main loop
;----
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Begin Farm Loop.`n, debug.log
;dump faction every 25 run attempts
Loop 25
{
WinWait, Guild Wars,
IfWinNotActive, Guild Wars, , WinActivate, Guild Wars,
WinWaitActive, Guild Wars,
gosub, Farm
cashExpected += 150
factionExpected += 800
}
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Begin Farm Submit.`n, debug.log
gosub, SubmitFaction
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Begin Spawn Reset.`n, debug.log
gosub, ResetSpawn
;gosub, EmptyRunDebug
}
;----
;this function farms for luxon faction in archipelagos
;----
Farm:
{
;----
;get into archipelagos
;----
;walk back into portal
Send {s 2}q
;wait for map to settle
Sleep 5000
;----
;setup for run
;----
;item spell prep
MouseClick, left, 261, 403
MouseClick, left, 262, 501
MouseClick, left, 260, 588
MouseClick, left, 269, 687
MouseClick, left, 259, 792
Sleep 500
;cast recall
Send /8
Sleep 500
;----
;start of run
;----
;open minimap
Send u
Sleep 500
Send {wheelup}
;send heroes up ramp
Send x
Sleep 500
MouseClick, left, 875, 331
;close minimap
Send u
;"Fall Back!" timer
Send 0
SetTimer, Fallback, 20000
;watchful intervention
Send 2
Sleep 1500
Send q
;prevent offensive spellcast
MouseClick, left, 262, 273
MouseClick, left, 255, 370
MouseClick, left, 259, 466
MouseClick, left, 260, 561
MouseClick, left, 258, 662
MouseClick, left, 256, 758
;"Incoming!" timer
Sleep 9000
Send {;}
SetTimer, Incoming, 20000
;wait for heroes to get up ramp
Sleep 2250
Send u
Sleep 500
;try one juke
Send x
Sleep 500
MouseClick, left, 798, 373
Send u
;----
;manage healing until recall triggers
;----
;wait for them to get to the hard part
Sleep 2500
;wait for hardest part to party heal
Sleep 3000
Send -1
;wait for heroes to be close enough
Sleep 750
;send heroes to base of cliff
Send u
Sleep 500
Send x
Sleep 500
MouseClick, left, 637, 238
;send frozen soil carrier to a safer location
Send j
Sleep 500
MouseClick, left, 671, 236
Send u
;dwarven stability
Sleep 7000
Send 6
;pious renewal, pious haste
Sleep 1000
Send 57
;wait for recall to trigger
Sleep 1750
;----
;get to quest giver, set up for the fight
;----
;follow heroes to base of cliff
Loop 26
{
Send {space}
Sleep 500
}
;stop speed boost timers
gosub, Speedboosts_off
;make haste
Send ]
;open minimap
Send u
;send the hero to follow up the cliff
Send o
Sleep 500
MouseClick, left, 739, 423
;send heroes to the arena
Send x
Sleep 500
MouseClick, left, 832, 408
;close minimap
Send u
;pious renewal, pious haste
Send 57
;follow hero up the cliff
Loop 30
{
Send {space}
Sleep 500
}
;edge of extinction
Send {[}
;open minimap
Send u
;send norgu back to the arena
Send o
Sleep 500
MouseClick, left, 886, 436
;close minimap
Send u
;speed boost norgu, prep panic
Send '{Insert}
;generous was tsungrai
MouseClick, left, 261, 403
MouseClick, left, 262, 501
MouseClick, left, 260, 588
MouseClick, left, 269, 687
MouseClick, left, 259, 792
;pious haste, renewal up ramp
Send q57
Sleep 1000
;fire attunement
MouseClick, left, 64, 410
MouseClick, left, 58, 497
MouseClick, left, 59, 603
MouseClick, left, 60, 689
MouseClick, left, 57, 787
Sleep 2000
;aura of restoration
MouseClick, left, 202, 787
MouseClick, left, 201, 692
MouseClick, left, 202, 595
MouseClick, left, 202, 503
MouseClick, left, 201, 400
;make sure frozen soil is down
Send {=}
;finish going up ramp
Sleep 2750
;talk to quest giver
Send .3
Sleep 750
Send {space}
;allow offensive spellcast
MouseClick, left, 205, 271
MouseClick, left, 208, 378
MouseClick, left, 209, 470
MouseClick, left, 204, 567
MouseClick, left, 202, 654
MouseClick, left, 207, 755
;glyph of immolation prep
;MouseClick, left, 112, 311
MouseClick, left, 117, 397
MouseClick, left, 123, 505
MouseClick, left, 115, 601
MouseClick, left, 115, 693
MouseClick, left, 114, 790
Sleep 1000
;----
;battle
;----
;start quest
MouseClick, left, 762, 544
;shroud of distress (protect from oni)
Send 4
;follow quest giver for 15 seconds
questDone := 0
SetTimer, questDoneCheck, 500
Sleep 250
Loop 55
{
if questDone {
break
}
Send {space}
Sleep 500
}
if questDone {
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] We found Accept: %Haystack2%, debug.log
} else {
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] We ran out of time.`n, debug.log
}
SetTimer, questDoneCheck, off
;----
;end of run
;----
;accept reward
MouseClick, left, 784, 532
Sleep 500
;repeat until accepted
Loop
{
Haystack := GetOCR(720,527,50,20,"activeWindow")
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Expected "Accept": OCR returned %Haystack%, debug.log
;if InStr(Haystack, "threshold") {
; FormatTime, TimeString,, hhmmss
; FileCopy, in.jpg, threshfail\in%TimeString%.jpg
;}
if !Haystack OR InStr(Haystack, "cc")
MouseClick, left, 784, 532
else
{
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] We broke on %Haystack%, debug.log
break
}
Sleep 500
}
;resign
Send {enter}/resign{enter}
Sleep 2500
;close any blocking windows
MouseClick, left, 918, 299
Sleep 250
MouseClick, left, 916, 318
Sleep 250
MouseClick, left, 918, 300
Sleep 500
MouseClick, left, 763, 458
Sleep 4500
}
return
SubmitFaction:
{
;----
;this function goes to eredon, dumps all the faction, and returns to jade flats
;----
;go to eredon terrace
Send m
Sleep 2000
MouseClick, left, 1082, 404
Sleep, 1500
MouseClick, left, 1082, 404
Sleep, 1500
MouseClick, left, 1082, 404
Sleep, 1500
MouseClick, left, 891, 669
Sleep 7000
;go to faction rewarder
Send 9{space}
Sleep 5000
Send .{space}
Sleep 5000
;if anything fails, don't allchat
Send {#}{enter}
Sleep 1000
Haystack := GetOCR(674, 263, 135, 20, "activeWindow")
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Expecting 'Luxon': OCR returned %Haystack%, debug.log
IfInString, Haystack, Luxon
{
;turn in faction
MouseClick, left, 778, 545
Sleep 500
Haystack := GetOCR(574, 376, 170, 17, "activeWindow")
IfInString, Haystack, Loyalty
{
MouseClick, left, 690, 500
Sleep 500
Send, Exergic{SPACE}Pan
Sleep 500
Loop
{
Haystack := GetOCR(574, 376, 170, 17, "activeWindow")
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Expecting 'Loyalty': OCR returned %Haystack%, debug.log
IfNotInString, Haystack, Loyalty, break
MouseClick, left, 871, 648
Sleep 500
}
}
}
;go back to jade flats
Sleep 2000
Send m
Sleep 2000
MouseClick, left, 1196, 424
Sleep, 1500
MouseClick, left, 1008, 488
Sleep, 1500
MouseClick, left, 909, 415
Sleep, 1500
MouseClick, left, 707, 678
Sleep 9000
}
Return
ResetSpawn:
{
;----
;this function uses an OCR library to go towards archipelagos, then reset the spawn
;----
;try first flag post
Send 9
#Include OCR.ahk
Sleep 750
fuckedUp := 0
Loop {
Haystack := GetOCR(721, 51, 146, 13, "activeWindow")
if Haystack
break
fuckedUp++
if fuckedUp > 20
{
FileAppend, [%TimeString%] We done gone 'head and fucked up.`n, debug.log
break
}
FileAppend, [%TimeString%] Warning: Reset spawn OCR was blank.`n, debug.log
}
if Haystack contains h,s,ga,pel,el,ip,ch,a5
{
;debug log, save all matches
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Expecting 'Archipelagos': OCR returned %Haystack%, debug.log
;if it matched, this is the right pole, go to it
Send {space}
Sleep 10000
}
else if Haystack contains M,ng,H
{
;go back to jade flats
FileAppend, [%TimeString%] Got stuck in Eredon, headed to Jade Flats`n, debug.log
Sleep 2000
Send m
Sleep 2000
MouseClick, left, 1196, 424
Sleep, 1500
MouseClick, left, 1008, 488
Sleep, 1500
MouseClick, left, 909, 415
Sleep, 1500
MouseClick, left, 707, 678
Sleep 9000
gosub, ResetSpawn
}
else
{
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Expecting 'The Jade Quarry': OCR returned %Haystack%, debug.log
;assuming it failed, go to the other flag
Send 9{space}
Sleep 15000
}
;point camera towards flag
Send {d down}
Send {d up}
Sleep 50
Send {d down}
Send {d up}
Sleep 250
;turn to the right a bit
Send {d down}
Sleep 700
Send {d up}
;go out to archipelagos
Send q
Sleep 7000
;go back to jade flats to reset the spawn
Send {s 2}q
Sleep 7000
}
return
EmptyRunDebug:
{
;walk back into portal
Send {s 2}q
;wait for map to settle
Sleep 8500
;resign
MouseClick, left, 918, 299
Send {enter}/resign{enter}
Sleep 4000
MouseClick, left, 763, 458
Sleep 7000
}
return
Speedboosts_off:
{
settimer, Fallback, off
settimer, Incoming, off
}
return
;"Fall Back!"
Fallback:
{
Send 0
}
return
;"Incoming!"
Incoming:
{
Send {;}
}
return
questDoneCheck:
{
Haystack2 := GetOCR(720,527,50,15,"activeWindow")
IfInString, Haystack2, cc
{
questDone := 1
}
}
return
ExitSub:
FormatTime, TimeString, T12, Time
FileAppend, [%TimeString%] Cash Expected: %cashExpected%g`n, debug.log
FileAppend, [%TimeString%] Faction Expected: %factionExpected%`n, debug.log
ExitApp