Skip to content

Commit

Permalink
adding functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pot0to committed Oct 16, 2024
1 parent b0e0bfd commit 2c4221a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- Svc.AetheryteList.FirstOrDefault(x => x.AetheryteId == aetheryteID)?.AetheryteData.GameData?.PlaceName.Value?.Name ?? string.Empty;
function GetAetheryteName(aetheryteId)
for i=0,AetheryteList.Count do
if AetheryteList[i] ~= nil then
if AetheryteList[i].AetheryteId == aetheryteId then
if AetheryteList[i].AetheryteData.GameData ~= nil then
if AetheryteList[i].AetheryteData.GameData.PlaceName.Value ~= nil then
if AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name ~= nil then
LogInfo(AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name)
return tostring(AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name):gsub(": %d+", "")
end
end
end
end
end
end
end

-- Svc.AetheryteList.Where(x => x.TerritoryId == zoneID).Select(x => x.AetheryteId).ToList();
function GetAetherytesInZone(zoneId)
local aetherytes = {}
for i=0,AetheryteList.Count do
if AetheryteList[i] ~= nil then
if AetheryteList[i].TerritoryId == zoneId then
yield("/echo "..AetheryteList[i].AetheryteId)
table.insert(aetherytes, AetheryteList[i].AetheryteId)
end
end
end
return aetherytes
end

for _, aetheryte in ipairs(GetAetherytesInZone(478)) do
yield("/echo "..aetheryte)
end

0 comments on commit 2c4221a

Please sign in to comment.