WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   World quests (https://www.wowinterface.com/forums/showthread.php?t=55486)

loff93 06-15-17 07:56 PM

World quests
 
Hey!
Trying to make my addon to show a specific world quest if it's active. What I do below doesn't seem to work as it's not in the QuestLog but I haven't found a function to find a World Quest without GetNumQuestLogEntries().

Code:

local function Quest_loop()
    for index = 1, GetNumQuestLogEntries(), 1 do
    local title, _, _, _, _, isComplete, _, questID = GetQuestLogTitle(index);
       
        if string.find(title, "Treasure Master Iks'reeged") or questID == 45379 then
        print(title, "is Active")
        end

    end
end

I know ingame I could just have used a macro like /dump IsQuestFlaggedCompleted(45379) or maybe a print (IsQuestFlaggedCompleted(45379))


Edit:
Ended up just using this code - since I only wanna check 1 world quest anyways.
Code:

function tore_questCheck(questID)
        local isComplete = IsQuestFlaggedCompleted(questID)
        if isComplete == false then
                print("Treasure Master Iks'reeged is Active")
        end
end


Gethe 06-15-17 11:25 PM

World quests have their own API and are referred to as TaskQuests. Some documentation is available here. The function you might use is C_TaskQuest.IsActive(questID).

loff93 06-15-17 11:36 PM

Quote:

Originally Posted by Gethe (Post 323825)
World quests have their own API and are referred to as TaskQuests. Some documentation is available here. The function you might use is C_TaskQuest.IsActive(questID).

Thanks for sharing!


All times are GMT -6. The time now is 01:59 PM.

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