# Lua script for World of Warcraft: Get Quest Info

I'm looking to make a very simple addon or even a macro where I can enter a quest ID and get the quest completion status. As it is, I know I can use IsQuestFlaggedCompleted to get the quest status, but I wanted to also get the name of the quest so the return in the chat log will show something a little more understandable. For example: Enter /questDone 43502 instead of just 43502: true as the output, I want it to look like A Change of Seasons: Quest Completed.

I see a function C_TaskQuest.GetQuestInfoByQuestID that's supposed to return the quest's title, but it doesn't seem to work as expected. It always seems to return nil for the quest name...

Try the following which creates a tooltip and scans the name:

local MyScanningTooltip = CreateFrame("GameTooltip", "MyScanningTooltip", UIParent, "GameTooltipTemplate")

local QuestTitleFromID = setmetatable({}, { __index = function(t, id)
MyScanningTooltip:SetOwner(UIParent, "ANCHOR_NONE")
local title = MyScanningTooltip.TextLeft1:GetText()
MyScanningTooltip:Hide()
if title and title ~= RETRIEVING_DATA then
t[id] = title
return title
end
end })


Then use this table like this:

print(QuestTitleFromID[43502])

• This absolutely doesn't answers the question. The OP looking for any quest-completition addon/macro - with specific usage, /questDone id1 or like. You just brutally copied some source code from the wowinterface and even doesn't citing the source. This is a bad manner... Aug 9 '19 at 13:55