-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10-HallOfHeroes-strategy.au3
More file actions
134 lines (116 loc) · 3.12 KB
/
Copy path10-HallOfHeroes-strategy.au3
File metadata and controls
134 lines (116 loc) · 3.12 KB
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
Func HallOfHeroes()
SkipCinematic()
Local $team = GetTeamColour()
PrintMapStart("Hall of Heroes", $team)
If GUICtrlRead($cbxLeaveBeforeHalls) == $GUI_CHECKED Then
Out("Error: Somehow got to Halls!")
TravelTo($ha)
EndIf
Local $lWonHoH = GetHeroTitleSafe()
SleepIfMapJustStarted(15000)
Upkeep()
Sleep(3000)
Out("Take ghostly")
GoNpcLog(FindMyGhostly())
Sleep(5000)
TargetNearestItem()
Sleep(GetPing()+100)
If GetCanPickup(GetTarget()) Then
Out("I think this is relic run")
PickupLoot()
Else
Out("No relic found")
EndIf
While GetMapLoading() == $instancetype_explorable And GetMapID() == $hoh
Local $agent = GetBestTarget()
Local $distance = GetDistance($agent, -2)
If CheckIsTeamWiped() Then ExitLoop
; Escourt Ghost
If $lWonHoH == GetHeroTitleSafe() Then
Local $myGhost = FindMyGhostly()
Local $distanceToGhost = GetDistance(-2, $myGhost)
Out ("Distance to Ghost " & $distanceToGhost)
If GetIsLiving() And IsDllStruct($myGhost) And $distanceToGhost > $rangeCompass Then
GoNpcLog($myGhost)
EndIf
ContinueLoop
EndIf
; Kill straglers
If CountEnemies($rangeCompass) > 0 Then
Out("Killing stragglers")
KillEnemy($rangeCompass)
ContinueLoop
EndIf
If $lWonHoH == GetHeroTitleSafe() Then
If Not CheckArea(26.6,6238) Then
If GetIsLiving() Then
If GetMapID() == $hoh Then
Out("Halls: Moving to centre")
;TODO make this "move aggroing"; catch people at our base
MoveTo(26.6,6238)
Sleep(1000)
EndIf
EndIf
EndIf
EndIf
If $lWonHoH == GetHeroTitleSafe() Then
Out("Halls: kill")
Local $distance = GetDistance(GetBestTarget())
If $distance < 1300 Then
KillEnemy()
EndIf
Sleep(1000)
EndIf
If $lWonHoH < GetHeroTitleSafe() Then
If GetMapID() == $hoh Then
Out("Halls: WON HALLS")
;RecordVictory($hoh)
$lWonHoH = GetHeroTitleSafe() ; Will make UpdateMapStats record a victory
GetHallsChest()
; Not easy to tell new map.
; Get position, wait for it to change.
If Not CheckArea(2.4, 4861.8) Then
Out("ERROR: Wait, not inside the chest area?")
MoveTo(2.4, 4861.8)
EndIf
While(CheckArea(2.4, 4861.8))
WaitMapLoading(0, 60000)
Out("Waiting for next halls instance")
WEnd
Out("Next instance of halls")
ExitLoop
EndIf
EndIf
Wend
UpdateMapStats($lWonHoH, $hoh, $team)
EndFunc ;==>hoh
Func GetHallsChest()
;0,4747.5
Local $inventoryBefore = CountBagsFreeSlots()
While GetMapLoading() == $instancetype_explorable And GetMapID() == $hoh
If Not GetIsLiving() Then
Out("ERROR: Halls: Died trying to get chest...?")
;Return
EndIf
If Not CheckArea(2.4, 4861.8) Then
Out("Halls: Moving to chest")
MoveTo(2.4, 4861.8)
Sleep(1000)
Else
TargetNearestItem()
Sleep(100)
Out("Halls: Open chest")
ActionInteract()
Sleep(5000)
Out("Halls: Loot")
PickupLoot()
;TODO log inventory status
EndIf
Local $inventoryAfter = CountBagsFreeSlots()
If $inventoryAfter < $inventoryBefore Then
Out("Picked up something! (" & $inventoryAfter & " > " & $inventoryBefore & ")")
ExitLoop
EndIf
WEnd
Out("Halls: Done with chest")
EndFunc