WoW:API GetQuestLogLeaderBoard: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API GetQuestLogLeaderBoard to API GetQuestLogLeaderBoard without leaving a redirect)
 
(9 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{wowapi}}
This function returns up to 3 values:
This function returns up to 3 values:


Line 6: Line 7:
;''Arguments''
;''Arguments''


:;i : Index of the quests objectives (see [[API GetNumQuestLeaderBoards|GetNumQuestLeaderBoards()]] ).
:;i : Index of the quests objective (see [[API GetNumQuestLeaderBoards|GetNumQuestLeaderBoards()]] ).


:;questID : Identifier of the quest. If not provided, default to the currently selected Quest, via [[API SelectQuestLogEntry|SelectQuestLogEntry()]].
:;questID : Identifier of the quest in the quest log. If not provided, default to the currently selected Quest, via [[API SelectQuestLogEntry|SelectQuestLogEntry()]].


----
----
Line 15: Line 16:
:;desc : String - The text description of the objective, like: "Kill foo: 0/3"
:;desc : String - The text description of the objective, like: "Kill foo: 0/3"


:;type : String - could be the following things: "item" or "monster".
:;type : String - could be the following things: "item", "object", "monster", "reputation", "log", or "event".


:;done : Boolean - ''nil'' if this sub objective is not completed yet, else 1
:;done : Boolean - ''nil'' if this sub objective is not completed yet, else 1


----
;''Useful examples''
function GetLeaderBoardDetails (boardIndex,questIndex)
  local leaderboardTxt, itemType, isDone = GetQuestLogLeaderBoard (boardIndex,questIndex);
  local i, j, itemName, numItems, numNeeded = string.find(leaderboardTxt, "(.*):%s*([%d]+)%s*/%s*([%d]+)");
  return itemType, itemName, numItems, numNeeded, isDone;
end
-- returns eg. "monster", "Young Nightsaber slain", 1, 7, nil


----
----
{{WoW API}}
;''Notes''
 
The type "player" was added in WotLK, which is used by {{questlong|Alliance|80|No Mercy!}} and probably other quests.
 
The type "log" was added sometime around patch 3.3.0, and seems to have replaced many instances of "event".
 
Only ever found one quest, {{quest|The Thandol Span (3)|The Thandol Span}} that had an "object" objective.
 
The "desc" returnvalue can be incomplete under some (unknown) circumstances containing an empty string or just says "slain" instead the real objective text.

Latest revision as of 04:46, 15 August 2023

WoW API < GetQuestLogLeaderBoard

This function returns up to 3 values:

local desc, type, done = GetQuestLogLeaderBoard(i, [questID])

Arguments
i
Index of the quests objective (see GetNumQuestLeaderBoards() ).
questID
Identifier of the quest in the quest log. If not provided, default to the currently selected Quest, via SelectQuestLogEntry().

Return values
desc
String - The text description of the objective, like: "Kill foo: 0/3"
type
String - could be the following things: "item", "object", "monster", "reputation", "log", or "event".
done
Boolean - nil if this sub objective is not completed yet, else 1

Useful examples
function GetLeaderBoardDetails (boardIndex,questIndex)
  local leaderboardTxt, itemType, isDone = GetQuestLogLeaderBoard (boardIndex,questIndex);
  local i, j, itemName, numItems, numNeeded = string.find(leaderboardTxt, "(.*):%s*([%d]+)%s*/%s*([%d]+)");
  return itemType, itemName, numItems, numNeeded, isDone;
end
-- returns eg. "monster", "Young Nightsaber slain", 1, 7, nil

Notes

The type "player" was added in WotLK, which is used by Template:Questlong and probably other quests.

The type "log" was added sometime around patch 3.3.0, and seems to have replaced many instances of "event".

Only ever found one quest, Template:Quest that had an "object" objective.

The "desc" returnvalue can be incomplete under some (unknown) circumstances containing an empty string or just says "slain" instead the real objective text.