API:GetPQTopContributors
From RoR Wiki
UI Lua API · PublicQuest functions
Version: WAR 1.4.8
Returns the top-contributor scoreboard of the public quest the player has just finished, together with the player's own standing.
data = GetPQTopContributors()
Arguments
None.
Returns
- data
table– Public quest result table (see below), or nothing if the client holds no public quest result.
| Key | Type | Meaning |
|---|---|---|
PQName |
wstring |
Name of the public quest. |
metMinContribution |
boolean |
– |
optedOut |
boolean |
– |
forcedOut |
boolean |
– |
numGoldSacks |
number |
Number of gold loot bags. |
numPurpleSacks |
number |
Number of purple loot bags. |
numBlueSacks |
number |
Number of blue loot bags. |
numGreenSacks |
number |
Number of green loot bags. |
numWhiteSacks |
number |
Number of white loot bags. |
numContributors |
number |
Total number of contributors. |
timeUntilPQReset |
number |
Seconds until the public quest resets (a stored millisecond value divided by 1000, rounded down). |
scoreboardData |
table |
Up to 24 contributor rows, see below. |
playerData |
table |
The local player's row, see below. |
Each row in scoreboardData:
| Key | Type | Meaning |
|---|---|---|
name |
wstring |
Character name. |
grade |
number |
– |
bonus |
number |
Contribution bonus. |
roll |
number |
persistence plus one other value stored for the row. bonus is not included.
|
persistence |
number |
– |
sackType |
number |
Always 7 in this function.
|
playerData has the same fields as a scoreboard row, plus place (number), the player's place on the scoreboard.
Details
- The three flags come from three bits of one stored value.
- The scoreboard has 24 fixed slots. Slots with an empty name are skipped, but each row keeps the index of its slot, so
scoreboardDatacan have gaps. playerDatais always filled, even if the player has no row.- The data is kept until ClearPQLootData is called; after that the function returns nothing.
- The stock UI calls this function when the public quest result window switches to its "top contributors" state (
PQData.ShowTopContributors).
Errors
None.
Example
From default/easystem_utils/source/publicqueststates.lua:
function PQData.ShowTopContributors()
PQData.currentState = PQData.STATE_SHOW_TOP_CONTRIBUTORS
local contributorsData = GetPQTopContributors()
if contributorsData == nil
then
return
end
PQData.ParseScoreboardData( contributorsData )
