WoW:API GetCurrencyInfo: Difference between revisions
Jump to navigation
Jump to search
(→Details: ; add Mists currencies and more) |
m (Move page script moved page API GetCurrencyInfo to API GetCurrencyInfo without leaving a redirect) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
Retrieve Information about a currency at index including it's amount. | Retrieve Information about a currency at index including it's amount. | ||
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> | <!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> | ||
name, CurrentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(index) | |||
== Arguments == | == Arguments == | ||
Line 10: | Line 10: | ||
== Returns == | == Returns == | ||
'''name''' | |||
'' String - the name of the currency, localized to the language'' | |||
'''amount''' | |||
''Number - Current amount of the currency at index'' | |||
'''texture''' | |||
''String - The file name of the currency's icon. As of 5.2.0, does include the path (\\Interface\\Icons\\)'' | |||
'''earnedThisWeek''' | |||
''Number - The amount of the currency earned this week'' | |||
'''weeklyMax''' | |||
''Number - Maximum amount of currency possible to be earned this week'' | |||
'''totalMax''' | |||
Number - Total maximum currency possible to stockpile | |||
'''isDiscovered''' | |||
Boolean - Whether the character has ever got some of this currency | |||
: <!-- Include this line ONLY IF there are multiple return values and a large number of arguments --><!-- List each return value, together with its type --> | |||
== Details == | == Details == | ||
<!-- Details not appropriate for the main description can go here. | <!-- Details not appropriate for the main description can go here. | ||
Line 21: | Line 43: | ||
* <code>index</code> appears to correspond to IDs seen at [[Wowhead]]'s currencies list.<ref name="wowheadCurrencies">{{ref web|work=[[Wowhead]]|url=http://mop.wowhead.com/currencies|title=Currencies|accessdate=9-Aug-2012}}</ref> | * <code>index</code> appears to correspond to IDs seen at [[Wowhead]]'s currencies list.<ref name="wowheadCurrencies">{{ref web|work=[[Wowhead]]|url=http://mop.wowhead.com/currencies|title=Currencies|accessdate=9-Aug-2012}}</ref> | ||
**As of [[patch 4.0.1]] (16-Oct-2010) new indexes: 241-Champion's Seal 390-Conquest Points 392-Honor Points 395-Justice Points | **As of [[patch 4.0.1]] (16-Oct-2010) new indexes: 241-Champion's Seal 390-Conquest Points 392-Honor Points 395-Justice Points | ||
**[[Patch 4.0.3]] (09-Aug-2012) - Table Updated ID's 0-1000 | **[[Patch 4.0.3]] (09-Aug-2012) - Table Updated ID's 0-1000 | ||
{| class="darktable zebra" | {| class="darktable zebra" | ||
|- | |- | ||
Line 28: | Line 50: | ||
| 61 || Dalaran Jewelcrafter's Token {{wotlk-inline}} (Dalaran {{ability|Jewelcrafting}} [[dailies]]) | | 61 || Dalaran Jewelcrafter's Token {{wotlk-inline}} (Dalaran {{ability|Jewelcrafting}} [[dailies]]) | ||
|- valign="top" | |- valign="top" | ||
| 81 || Dalaran Cooking Award {{wotlk-inline}}<br/>(Dalaran {{ability|Cooking}} [[dailies]]; becomes Epicurean's Award {{mists-inline}} | | 81 || Dalaran Cooking Award {{wotlk-inline}}<br />(Dalaran {{ability|Cooking}} [[dailies]]; becomes Epicurean's Award {{mists-inline}}) | ||
|- | |- | ||
| 241 || Champion's Seal {{wotlk-inline}} ([[Argent Tournament]]) | | 241 || Champion's Seal {{wotlk-inline}} ([[Argent Tournament]]) | ||
Line 36: | Line 58: | ||
| 384 || Dwarf Archaeology Fragment {{cata-inline}} | | 384 || Dwarf Archaeology Fragment {{cata-inline}} | ||
|- | |- | ||
| 385 || Troll Archaeology Fragment | | 385 || Troll Archaeology Fragment {{cata-inline}} | ||
|- | |- | ||
| 390 || Conquest Points {{cata-inline}} ([[PvP]], Ranked [[Arena PvP system|Arena]]/[[Rated battleground]]) | | 390 || Conquest Points {{cata-inline}} ([[PvP]], Ranked [[Arena PvP system|Arena]]/[[Rated battleground]]) | ||
Line 72: | Line 94: | ||
| 615 || Essence of Corrupted Deathwing {{cata-inline}} ([[Madness of Deathwing]]) | | 615 || Essence of Corrupted Deathwing {{cata-inline}} ([[Madness of Deathwing]]) | ||
|- | |- | ||
| 676 || Pandaren Archaeology Fragment {{mists-inline}} | | 676 || Pandaren Archaeology Fragment {{mists-inline}} | ||
|- | |- | ||
| 679 || Elder Charm of Good Fortune {{mists-inline}} | | 679 || Elder Charm of Good Fortune {{mists-inline}} | ||
|- | |||
| 692 || Conquest Random BG Meta {{mists-inline}} | |||
|- | |||
| 697 || Elder Charm of Good Fortune {{mists-inline}} | |||
|- | |||
| 738 || Lesser Charm of Good Fortune {{mists-inline}} | |||
|- | |||
| 752 || Mogu Rune of Fate {{mists-inline}} | |||
|- | |||
| 776 || Warforged Seal {{mists-inline}} | |||
|- | |||
| 777 || Timeless Coin {{mists-inline}} | |||
|} | |} | ||
== Example(s) == | |||
# This Example will Output every currency you have Discovered, and have at least one of, to the Main chat Frame. | |||
local name, currentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = nil,nil,nil,nil,nil,nil,nil; | |||
for i = 61,777,1 do | |||
name, currentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(i); | |||
if name ~= nil and isDiscovered and currentAmount > 0 then | |||
if weeklyMax > 0 then | |||
DEFAULT_CHAT_FRAME:AddMessage(string.format("(%s): Current: %d Earned This Week: %d/%d",name,currentAmount,earnedThisWeek,weeklyMax)) | |||
else | |||
DEFAULT_CHAT_FRAME:AddMessage(string.format("(%s): Current: %d",name,currentAmount)) | |||
end | |||
end | |||
end | |||
== Patch Changes == | |||
* Some time after Patch 4.0.1, the returns changed from "localized_label, amount, icon_file_name = GetCurrencyInfo(id)" to "name, currentAmount, texture, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(index)" | |||
== References == | == References == | ||
{{reflist}} | {{reflist}} |
Latest revision as of 04:45, 15 August 2023
Retrieve Information about a currency at index including it's amount.
name, CurrentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(index)
Arguments[edit]
- index
- Integer - Index of the currency to retrieve
Returns[edit]
name
String - the name of the currency, localized to the language
amount
Number - Current amount of the currency at index
texture
String - The file name of the currency's icon. As of 5.2.0, does include the path (\\Interface\\Icons\\)
earnedThisWeek
Number - The amount of the currency earned this week
weeklyMax
Number - Maximum amount of currency possible to be earned this week
totalMax
Number - Total maximum currency possible to stockpile
isDiscovered
Boolean - Whether the character has ever got some of this currency
Details[edit]
index
appears to correspond to IDs seen at Wowhead's currencies list.[1]- As of patch 4.0.1 (16-Oct-2010) new indexes: 241-Champion's Seal 390-Conquest Points 392-Honor Points 395-Justice Points
- Patch 4.0.3 (09-Aug-2012) - Table Updated ID's 0-1000
index | name |
---|---|
61 | Dalaran Jewelcrafter's Token Template:Wotlk-inline (Dalaran Template:Ability dailies) |
81 | Dalaran Cooking Award Template:Wotlk-inline (Dalaran Template:Ability dailies; becomes Epicurean's Award Template:Mists-inline) |
241 | Champion's Seal Template:Wotlk-inline (Argent Tournament) |
361 | Illustrious Jewelcrafter's Token Template:Cata-inline (Template:Ability dailies) |
384 | Dwarf Archaeology Fragment Template:Cata-inline |
385 | Troll Archaeology Fragment Template:Cata-inline |
390 | Conquest Points Template:Cata-inline (PvP, Ranked Arena/Rated battleground) |
391 | Tol Barad Commendation Template:Cata-inline |
392 | Honor Points (PvP) |
393 | Fossil Archaeology Fragment Template:Cata-inline |
394 | Night Elf Archaeology Fragment Template:Cata-inline |
395 | Justice Points Template:Cata-inline |
396 | Valor Points Template:Cata-inline |
397 | Orc Archaeology Fragment Template:Cata-inline |
398 | Draenei Archaeology Fragment Template:Cata-inline |
399 | Vrykul Archaeology Fragment Template:Cata-inline |
400 | Nerubian Archaeology Fragment Template:Cata-inline |
401 | Tol'vir Archaeology Fragment Template:Cata-inline |
402 | Chef's Award Template:Cata-inline (Template:Ability dailies) |
416 | Mark of the World Tree Template:Cata-inline (Molten Front, Firelands) |
515 | Darkmoon Prize Ticket Template:Cata-inline |
614 | Mote of Darkness Template:Cata-inline (Dragon Soul) |
615 | Essence of Corrupted Deathwing Template:Cata-inline (Madness of Deathwing) |
676 | Pandaren Archaeology Fragment Template:Mists-inline |
679 | Elder Charm of Good Fortune Template:Mists-inline |
692 | Conquest Random BG Meta Template:Mists-inline |
697 | Elder Charm of Good Fortune Template:Mists-inline |
738 | Lesser Charm of Good Fortune Template:Mists-inline |
752 | Mogu Rune of Fate Template:Mists-inline |
776 | Warforged Seal Template:Mists-inline |
777 | Timeless Coin Template:Mists-inline |
Example(s)[edit]
- This Example will Output every currency you have Discovered, and have at least one of, to the Main chat Frame.
local name, currentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = nil,nil,nil,nil,nil,nil,nil; for i = 61,777,1 do name, currentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(i); if name ~= nil and isDiscovered and currentAmount > 0 then if weeklyMax > 0 then DEFAULT_CHAT_FRAME:AddMessage(string.format("(%s): Current: %d Earned This Week: %d/%d",name,currentAmount,earnedThisWeek,weeklyMax)) else DEFAULT_CHAT_FRAME:AddMessage(string.format("(%s): Current: %d",name,currentAmount)) end end end
Patch Changes[edit]
- Some time after Patch 4.0.1, the returns changed from "localized_label, amount, icon_file_name = GetCurrencyInfo(id)" to "name, currentAmount, texture, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(index)"
References[edit]
- ↑ Currencies. Wowhead. Retrieved on 2012-08-09.