WoW:API GetQuestLogTitle: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Added isDaily description)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns information about a quest in your quest log.
Returns information about a quest in your quest log.
  questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questID);
  questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(questID);


==Parameters==
==Parameters==
Line 15: Line 15:
:;isCollapsed : Boolean - 1 if the entry is a collapsed header, nil otherwise.
:;isCollapsed : Boolean - 1 if the entry is a collapsed header, nil otherwise.
:;isComplete : Integer - -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.
:;isComplete : Integer - -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.
:;isDaily : Integer - 1 if the quest is daily. (Added in 2.1.0). If questTag is not nil and isDaily is true, then questTag will be format with DAILY_QUEST_TAG_TEMPLATE and displayed in QuestLogFrame.


<div id="questTag">questTag localization: </div>while the value of questTag is localized, it is stored in GlobalStrings.lua as ELITE, LFG_TYPE_DUNGEON, PVP, RAID and GROUP respectively.


<div id="questTag">questTag localization: </div>while the value of questTag is localized, it is stored in GlobalStrings.lua as ELITE, LFG_TYPE_DUNGEON, PVP, RAID and GROUP respectively.


==Example==
==Example==
Line 23: Line 24:
  while (GetQuestLogTitle(i+1) ~= nil) do
  while (GetQuestLogTitle(i+1) ~= nil) do
   i = i + 1;
   i = i + 1;
   local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete = GetQuestLogTitle(i);
   local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(i);
   if (not header) then
   if (not header) then
   DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
   DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");

Revision as of 12:12, 27 May 2007

WoW API < GetQuestLogTitle

Returns information about a quest in your quest log.

questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(questID);

Parameters

Arguments

questID
Integer - The index of the quest you wish to get information about.

Returns

questTitle
String - The title of the quest, or nil if the index is out of range.
level
Integer - The level of the quest
questTag
String - Should be "Elite", "Dungeon", "PVP", "Raid", "Group" or nil (return value is #questTag).
suggestedGroup
Integer - if questTag is GROUP, the positive number of players suggested for the quest or nil (added in 2.0.3)
isHeader
Boolean - 1 if the entry is a header, nil otherwise.
isCollapsed
Boolean - 1 if the entry is a collapsed header, nil otherwise.
isComplete
Integer - -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.
isDaily
Integer - 1 if the quest is daily. (Added in 2.1.0). If questTag is not nil and isDaily is true, then questTag will be format with DAILY_QUEST_TAG_TEMPLATE and displayed in QuestLogFrame.
questTag localization:

while the value of questTag is localized, it is stored in GlobalStrings.lua as ELITE, LFG_TYPE_DUNGEON, PVP, RAID and GROUP respectively.


Example

local i=0;
while (GetQuestLogTitle(i+1) ~= nil) do
 i = i + 1;
 local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(i);
 if (not header) then
  DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
  return;
 end
end

Result

Prints the name and the level of all quests in your quest log.