API:GetQuestNameByIndex

Gets the name of a quest from the NPC Quest Dialog

GetQuestNameByIndex(type, index)

Arguments

 *  type
 * type of quest: 1 - not accepted, 2 - accepted, not completed, 3 - completed


 *  index
 * index of quest in the NPC's quest dialog

Returns
The name of the indexed quest

note

 * NPC dialog has to be open and contain quests

Example
-- Accepts a quest by quest name acceptQuest = "Golden Statue Auction"

for i = 1,GetNumQuest(1) do   if GetQuestNameByIndex(1, i) == acceptQuest then OnClick_QuestListButton(1,i) -- Clicks the quest AcceptQuest -- Accepts the quest end end

Related functions

 * API:OnClick_QuestListButton - Selects a quest by quest type
 * API:GetNumQuest - Returns the number of quests by quest type