<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetPQTopContributors</id>
	<title>API:GetPQTopContributors - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetPQTopContributors"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetPQTopContributors&amp;action=history"/>
	<updated>2026-10-17T07:30:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetPQTopContributors&amp;diff=30447&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetPQTopContributors&amp;diff=30447&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:43Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=PublicQuest}}&lt;br /&gt;
Returns the top-contributor scoreboard of the public quest the player has just finished, together with the player&amp;#039;s own standing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = GetPQTopContributors()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;data : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Public quest result table (see below), or nothing if the client holds no public quest result.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PQName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the public quest.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metMinContribution&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;optedOut&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;forcedOut&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numGoldSacks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of gold loot bags.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numPurpleSacks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of purple loot bags.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numBlueSacks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of blue loot bags.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numGreenSacks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of green loot bags.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numWhiteSacks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of white loot bags.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;numContributors&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Total number of contributors.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;timeUntilPQReset&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Seconds until the public quest resets (a stored millisecond value divided by 1000, rounded down).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Up to 24 contributor rows, see below.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || The local player&amp;#039;s row, see below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each row in &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Character name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;grade&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bonus&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Contribution bonus.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;roll&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;persistence&amp;lt;/code&amp;gt; plus one other value stored for the row. &amp;lt;code&amp;gt;bonus&amp;lt;/code&amp;gt; is not included.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;persistence&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sackType&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Always &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this function.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt; has the same fields as a scoreboard row, plus &amp;lt;code&amp;gt;place&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;), the player&amp;#039;s place on the scoreboard.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The three flags come from three bits of one stored value.&lt;br /&gt;
* The scoreboard has 24 fixed slots. Slots with an empty name are skipped, but each row keeps the index of its slot, so &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;gt; can have gaps.&lt;br /&gt;
* &amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt; is always filled, even if the player has no row.&lt;br /&gt;
* The data is kept until [[API:ClearPQLootData|ClearPQLootData]] is called; after that the function returns nothing.&lt;br /&gt;
* The stock UI calls this function when the public quest result window switches to its &amp;quot;top contributors&amp;quot; state (&amp;lt;code&amp;gt;PQData.ShowTopContributors&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/easystem_utils/source/publicqueststates.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function PQData.ShowTopContributors()&lt;br /&gt;
    PQData.currentState = PQData.STATE_SHOW_TOP_CONTRIBUTORS&lt;br /&gt;
    local contributorsData = GetPQTopContributors()&lt;br /&gt;
&lt;br /&gt;
    if contributorsData == nil&lt;br /&gt;
    then&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    PQData.ParseScoreboardData( contributorsData )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetPQLootWinners|GetPQLootWinners]]&lt;br /&gt;
* [[API:ClearPQLootData|ClearPQLootData]]&lt;br /&gt;
* [[API:PQLootItem|PQLootItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>