From d778f4b1738f21c7bc92ffdc452990370c5680ee Mon Sep 17 00:00:00 2001 From: pot0to <19513249+pot0to@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:29:25 -0700 Subject: [PATCH] fixing unsync for trials, raids --- Dailies/Allied Society Quests.lua | 154 ++++++++++++++++++++++++++++++ Dailies/Treasure Map Gatherer.lua | 4 +- functions.lua | 31 +++++- 3 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 Dailies/Allied Society Quests.lua diff --git a/Dailies/Allied Society Quests.lua b/Dailies/Allied Society Quests.lua new file mode 100644 index 0000000..c6d3367 --- /dev/null +++ b/Dailies/Allied Society Quests.lua @@ -0,0 +1,154 @@ +--[[ +******************************************************************************** +* Allied Society Quests * +* Version 0.0.0 * +******************************************************************************** + +--]] + +ToDoList = { "Arkosodara" } + +--[[ +******************************************************************************** +* Code: Don't touch this unless you know what you're doing * +******************************************************************************** +]] + +AlliedSocietiesTable = +{ + arkosodara = + { + alliedSocietyName = "Arkosodara", + questGiver = "Maru", + x = -68.21, + y = 39.99, + z = 323.31, + zoneId = 957, + aetheryteName = "Yedlihmad" + }, + loporrits = + { + alliedSocietyName = "Loporrits", + questGiver = "Managingway", + x = -201.27, + y = -49.15, + z = -273.8, + zoneId = 959, + aetheryteName = "Bestways Burrow" + }, + omicrons = + { + alliedSocietyName = "Omicrons", + questGiver = "Stigma-4", + x=315.84, + y=481.99, + z=152.08, + zoneId = 960, + aetheryteName = "Base Omicron" + } +} + +CharacterCondition = { + dead=2, + mounted=4, + inCombat=26, + casting=27, + occupied31=31, + occupiedShopkeeper=32, + occupied=33, + boundByDuty34=34, + occupiedMateriaExtraction=39, + betweenAreas=45, + jumping48=48, + jumping61=61, + occupiedSummoningBell=50, + betweenAreasForDuty=51, + boundByDuty56=56, + mounting57=57, + mounting64=64, + beingmoved70=70, + beingmoved75=75, + flying=77 +} + +function GetAlliedSocietyTable(alliedSocietyName) + for _, alliedSociety in pairs(AlliedSocietiesTable) do + if alliedSociety.alliedSocietyName == alliedSocietyName then + return alliedSociety + end + end +end + +function CheckAllowances() + if not IsAddonVisible("ContentsInfo") then + yield("/timers") + yield ("/wait 1") + end + + for i = 1, 15 do + local timerName = GetNodeText("ContentsInfo", 8, i, 5) + if timerName == "Next Allied Society Daily Quest Allowance" then + return tonumber(GetNodeText("ContentsInfo", 8, i, 4):match("%d+$")) + end + end + return 0 +end + +function TeleportTo(aetheryteName) + yield("/tp "..aetheryteName) + 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") + LastTeleportTimeStamp = EorzeaTimeToUnixTime(GetCurrentEorzeaTimestamp()) +end + +yield("/at y") +for _, alliedSocietyName in ipairs(ToDoList) do + yield("/echo 1") + local startingAllowances = CheckAllowances() + yield("/echo "..startingAllowances) + local alliedSocietyTable = GetAlliedSocietyTable(alliedSocietyName) + if alliedSocietyTable ~= nil then + if not IsInZone(alliedSocietyTable.zoneId) then + TeleportTo(alliedSocietyTable.aetheryteName) + end + + if not GetCharacterCondition(4) then + yield('/gaction "mount roulette"') + end + PathfindAndMoveTo(alliedSocietyTable.x, alliedSocietyTable.y, alliedSocietyTable.z, true) + repeat + yield("/wait 1") + until not PathIsRunning() and not PathfindInProgress() + + -- accept 3 allocations + for i=1,3 do + yield("/target "..alliedSocietyTable.questGiver) + yield("/interact") + + repeat + yield("/wait 1") + until IsAddonVisible("SelectIconString") + yield("/callback SelectIconString true 0") + + repeat + yield("/wait 1") + until not IsPlayerOccupied() + end + + yield("/qst start") + repeat + yield("/wait 10") + yield("/echo "..CheckAllowances()) + yield("/echo "..startingAllowances) + until CheckAllowances() == startingAllowances - 3 + end +end diff --git a/Dailies/Treasure Map Gatherer.lua b/Dailies/Treasure Map Gatherer.lua index 4812f21..44e85be 100644 --- a/Dailies/Treasure Map Gatherer.lua +++ b/Dailies/Treasure Map Gatherer.lua @@ -27,7 +27,7 @@ Gathers a map, relogs as the next character in the list, and repeat. * Required Plugins * ******************************************************************************** 1. Vnavmesh -2. Gather Buddy Reborn +2. Gather Buddy Reborn - Create an autogather list with your desired map 3. Autoretainer ]] @@ -39,7 +39,7 @@ Gathers a map, relogs as the next character in the list, and repeat. ******************************************************************************** ]] -MapName = "Timeworn Gazelleskin Map" +MapName = "Timeworn Gazelleskin Map" -- must match the map on your GBR list Multimode = true Characters = diff --git a/functions.lua b/functions.lua index be45204..3ee94bc 100644 --- a/functions.lua +++ b/functions.lua @@ -7,7 +7,7 @@ function GetAetheryteName(aetheryteId) 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+", "") + return tostring(AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name):match("(.+):") end end end @@ -30,6 +30,29 @@ function GetAetherytesInZone(zoneId) return aetherytes end -for _, aetheryte in ipairs(GetAetherytesInZone(478)) do - yield("/echo "..aetheryte) -end \ No newline at end of file +-- Svc.AetheryteList.FirstOrDefault(x => x.AetheryteId == aetheryteID)?.AetheryteData.GameData?.Level.FirstOrDefault()?.Value?.X ?? 0; +function GetAetheryteRawPos(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.Map ~= nil then + yield("/echo map not nil") + local level = AetheryteList[i].AetheryteData.GameData.Map + LogInfo(AetheryteList[i].AetheryteData.GameData.Level[1].X) + if AetheryteList[i].AetheryteData.GameData.Level[1].Value ~= nil then + + yield("/echo level value not nil") + return level.Value.X, level.Value.Y, level.Value.Z + end + yield("/echo level value is nil") + end + end + end + end + end + return 0, 0, 0 +end + +local x,y,z = GetAetheryteRawPos(210) +yield("/echo "..x..", "..y..", "..z) \ No newline at end of file