C_TaskQuest.GetQuestTimeLeftMinutes
I'm trying to get expirations on certain world quests as soon as I log in. Any ideas why print() step 4 below is failing? If I wait for 10-15 sec and run lines 4-8 again from a function, it reports the minutes as expected. It also succeeds if I have been logged in for 10-15 sec and /reload. It only fails when first logging in. I have tried all of the RegisterEvent() options listed in the login sequence of the addon loading process.
Lua Code:
|
Sounds like there is another event you have to wait for.
You could try the following event and its linked function call. https://warcraft.wiki.gg/wiki/QUEST_DATA_LOAD_RESULT https://warcraft.wiki.gg/wiki/API_C_...tLoadQuestByID |
Quote:
Quote:
|
The only ones I would check next would be
UNIT_QUEST_LOG_CHANGED - https://warcraft.wiki.gg/wiki/UNIT_QUEST_LOG_CHANGED And then ... TASK_PROGRESS_UPDATE - https://warcraft.wiki.gg/wiki/TASK_PROGRESS_UPDATE QUEST_LOG_UPDATE - https://warcraft.wiki.gg/wiki/QUEST_LOG_UPDATE Otherwise I would use the /etrace command to see what events trigger soon after you log in https://warcraft.wiki.gg/wiki/MACRO_eventtrace |
Quote:
|
Quote:
|
Yeah, etrace is a nightmare to unravel. But you can *remove* events you don't want to see - at least I remember doing that when I last played with it an expansion or two back. And it will stop showing them allowing you to narrow it down to events that triggered just after you logged in that you weren't tracking in your addon. Until you see which events were first firing after the PLAYER_LOGIN and PLAYER_ENTERING_WORLD ( which triggers on any reload ) events you won't know which ones to check on.
|
Quote:
|
The only thing I can think of, is registering for all events and save it out to a saved variables table. And then check what events fired, when and with what values.
https://warcraft.wiki.gg/wiki/API_Fr...isterAllEvents https://warcraft.wiki.gg/wiki/API_Fr...isterAllEvents Basically set up a saved variable table like EventDebug. And in the event callback function add the information to the table. An untested example would be something as follows. Just log in, then log out and see what it is in the table. I've used something like this in the past when I've had similar puzzles to solve. If you find it useful and want to add it to your addons you can always include and use a slash command to turn off and on the registering of all events or have a variable at the top of the file that is checked before registering the events. Lua Code:
|
All times are GMT -6. The time now is 03:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI