Thread Tools Display Modes
11-19-23, 06:59 AM   #1
wisocko
A Murloc Raider
Join Date: Nov 2023
Posts: 6
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:
  1. local f=CreateFrame("Frame");
  2. f:RegisterEvent("PLAYER_LOGIN");
  3. f:SetScript("OnEvent",function(self,event,...)
  4.     print(1)
  5.     print(2,C_TaskQuest.GetQuestInfoByQuestID(65143))
  6.     print(3,GetTaskInfo(65143))
  7.     print(4,C_TaskQuest.GetQuestTimeLeftMinutes(65143))
  8.     print(5)
  9. end);

Last edited by wisocko : 11-19-23 at 07:02 AM.
  Reply With Quote
11-19-23, 08:35 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
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
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-21-23, 04:33 PM   #3
wisocko
A Murloc Raider
Join Date: Nov 2023
Posts: 6
Originally Posted by Xrystal View Post
Sounds like there is another event you have to wait for.
Agreed; if someone knows which event, I'd like to know what it is.

Originally Posted by Xrystal View Post
None of these did the trick, unfortunately. Still stymied on this one.
  Reply With Quote
11-21-23, 09:04 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
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
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-23-23, 04:08 PM   #5
wisocko
A Murloc Raider
Join Date: Nov 2023
Posts: 6
Originally Posted by Xrystal View Post
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
No go on the event options, but /etrace is amazing! I had no idea it was a thing. I'll give it a shot next login. Thanks!
  Reply With Quote
11-23-23, 07:16 PM   #6
wisocko
A Murloc Raider
Join Date: Nov 2023
Posts: 6
Originally Posted by Xrystal View Post
Otherwise I would use the /etrace command to see what events trigger soon after you log in
https://warcraft.wiki.gg/wiki/MACRO_eventtrace
I'm not finding documentation on how to fire /etrace on login. By the time I can enter it in chat, lots of events have gone by. EventTrace:SetLoggingPaused(false) doesn't seem to help. I have the "log events when hidden" option turned on in the /etrace window, but no events register that occurred before the window opens. If I can find some way to open it programmatically on ADDON_LOADED, that would be early enough for me.

Last edited by wisocko : 11-23-23 at 07:21 PM. Reason: formatting
  Reply With Quote
11-24-23, 12:14 AM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » C_TaskQuest.GetQuestTimeLeftMinutes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off