WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Any possible ways to obtain all order hall missions for each classes? (https://www.wowinterface.com/forums/showthread.php?t=55828)

Layback_ 10-30-17 06:33 PM

Any possible ways to obtain all order hall missions for each classes?
 
I could easily get all those available, in progress and complete missions with built in WoW APIs, but there seems to be no way to obtain all those order hall missions for each classes (including those missions which are currently not available or in CD).

Are those data stored in server side database, only?

Thank you!

-- EDIT #1

Quote:

I could easily get all those available, in progress and complete missions with built in WoW APIs, but ...
I was wrong.

Collecting those (available, in progress and complete missions) data were also not straight forward(?), as it seems like there's a slight delay on getting all data on first login.

The following those not insert data into a missions table.

Lua Code:
  1. local f = CreateFrame("Frame");
  2. f:RegisterEvent("PLAYER_ENTERING_WORLD");
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     if event == "PLAYER_ENTERING_WORLD" then
  5.         if not IsAddOnLoaded("Blizzard_GarrisonUI") then
  6.             LoadAddOn("Blizzard_GarrisonUI");
  7.         end
  8.  
  9.         local missions = {};
  10.         missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  11.         missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  12.         missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  13.  
  14.         for state, missionList in pairs(missions) do
  15.             for i = 1, #missionList do
  16.                 local mission = missionList[i];
  17.  
  18.                 mission.info = {GetMissionInfo(mission.missionID)};
  19.             end
  20.         end
  21.  
  22.         _G["missions"] = missions;
  23.  
  24.         f:UnregisterEvent("PLAYER_ENTERING_WORLD");
  25.     end
  26. end);

Thus, I had to give it a x seconds of delay to give it a time to collect its data.

Lua Code:
  1. local f = CreateFrame("Frame");
  2. f:RegisterEvent("PLAYER_ENTERING_WORLD");
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     if event == "PLAYER_ENTERING_WORLD" then
  5.         C_Timer.After(5, function()
  6.             if not IsAddOnLoaded("Blizzard_GarrisonUI") then
  7.                 LoadAddOn("Blizzard_GarrisonUI");
  8.             end
  9.  
  10.             local missions = {};
  11.             missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  12.             missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  13.             missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  14.  
  15.             for state, missionList in pairs(missions) do
  16.                 for i = 1, #missionList do
  17.                     local mission = missionList[i];
  18.  
  19.                     mission.info = {GetMissionInfo(mission.missionID)};
  20.                 end
  21.             end
  22.  
  23.             _G["missions"] = missions;
  24.  
  25.             f:UnregisterEvent("PLAYER_ENTERING_WORLD");
  26.         end);
  27.     end
  28. end);

It worked okay, but I don't get why it needs a such delay :confused:

Would that be because it's getting all missions data from server?


All times are GMT -6. The time now is 12:34 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI