forked from pot0to/pot0to-SND-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTreasure Hunt Helper.lua
170 lines (138 loc) · 5.35 KB
/
Treasure Hunt Helper.lua
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
--[[
********************************************************************************
* Treasure Hunt Helper *
********************************************************************************
You must start with an open map in your inventory. This script will
automatically teleport you to the correct zone, fly over, dig, kill enemies,
and open the chest. It will NOT do portals for you.
********************************************************************************
* Version 1.0.0 *
********************************************************************************
Created by: pot0to (https://ko-fi.com/pot0to)
-> 1.0.0 First release
********************************************************************************
* Required Plugins *
********************************************************************************
Plugins that are needed for it to work:
-> Something Need Doing [Expanded Edition] : Main Plugin for everything to work (https://puni.sh/api/repository/croizat)
-> Globetrotter : For finding the treasure map spot
-> VNavmesh : For Pathing/Moving (https://puni.sh/api/repository/veyn)
-> RSR : For fighting things
********************************************************************************
* Optional Plugins *
********************************************************************************
This Plugins are optional and not needed unless you have it enabled in the settings:
-> Teleporter : (for Teleporting to Ishgard/Firmament if you're not already in that zone)
]]
--#region Settings
--[[
********************************************************************************
* Settings *
********************************************************************************
]]
CharacterCondition = {
dead=2,
mounted=4,
inCombat=26,
casting=27,
occupied31=31,
occupied=33,
boundByDuty34=34,
betweenAreas=45,
jumping48=48,
jumping61=61,
mounting57=57,
mounting64=64,
beingmoved70=70,
beingmoved75=75,
flying=77
}
-- #region Movement
function TeleportToFlag()
yield("/tp " .. GetAetheryteName(GetAetherytesInZone(GetFlagZone())[0]))
yield("/wait 1") -- wait for casting to begin
while GetCharacterCondition(CharacterCondition.casting) do
LogInfo("[FATE] Casting teleport...")
yield("/wait 1")
end
yield("/wait 1") -- wait for that microsecond in between the cast finishing and the transition beginning
while GetCharacterCondition(CharacterCondition.betweenAreas) do
LogInfo("[FATE] Teleporting...")
yield("/wait 1")
end
yield("/wait 1")
end
function GoToMapLocation()
if PathfindInProgress() or PathIsRunning() then
return
end
if not IsInZone(GetFlagZone()) then
TeleportToFlag()
return
end
if not GetCharacterCondition(CharacterCondition.mounted) then
yield('/gaction "mount roulette"')
return
end
yield("/vnav flyflag")
end
--#endregion Movement
function Main()
if GetCharacterCondition(CharacterCondition.inCombat) and not HasTarget() then
yield("/battletarget")
return
end
yield("/tmap")
if not IsInZone(GetFlagZone()) or GetDistanceToPoint(GetFlagXCoord(), GetPlayerRawYPos(), GetFlagYCoord()) > 5 then
GoToMapLocation()
return
end
if GetCharacterCondition(CharacterCondition.mounted) then
yield("/ac dismount")
if PathfindInProgress() or PathIsRunning() then
yield("/vnav stop")
end
yield("/wait 1")
return
end
if not GetCharacterCondition(CharacterCondition.inCombat) and (not HasTarget() or GetTargetName() ~= "Treasure Coffer") then
yield("/generalaction Dig")
yield("/target Treasure Coffer")
return
end
if GetDistanceToPoint(GetTargetRawXPos(), GetTargetRawYPos(), GetTargetRawZPos()) > 3.5 then
PathfindAndMoveTo(GetTargetRawXPos(), GetTargetRawYPos(), GetTargetRawZPos())
return
end
if IsAddonVisible("SelectYesno") then
yield("/echo see yesno")
yield("/callback SelectYesno true 0") -- yes open the coffer
HasOpenMap = false
end
if not GetCharacterCondition(CharacterCondition.inCombat) then
if GetCharacterCondition(CharacterCondition.boundByDuty34) then
StopFlag = true
end
yield("/interact")
return
end
yield("/rotation manual")
yield("/battletarget")
end
HasOpenMap = true
StopFlag = false
repeat
if not (IsPlayerCasting() or
GetCharacterCondition(CharacterCondition.betweenAreas) or
GetCharacterCondition(CharacterCondition.jumping48) or
GetCharacterCondition(CharacterCondition.jumping61) or
GetCharacterCondition(CharacterCondition.mounting57) or
GetCharacterCondition(CharacterCondition.mounting64) or
GetCharacterCondition(CharacterCondition.beingmoved70) or
GetCharacterCondition(CharacterCondition.beingmoved75) or
LifestreamIsBusy())
then
Main()
yield("/wait 0.1")
end
until StopFlag