WoW:API GetTradeSkillInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(upgraded deprecated template)
Line 1: Line 1:
{{wowapi}}
<center>'''GetTradeSkillInfo''' - ''Documentation edited by wowpendium.de''</center>
<center>'''GetTradeSkillInfo''' - ''Documentation edited by wowpendium.de''</center>


Line 35: Line 36:
== Details ==
== Details ==
: Retrieves the name of the skill, the type of the skill and the amount the player can craft for a specific crafting skill.
: Retrieves the name of the skill, the type of the skill and the amount the player can craft for a specific crafting skill.
----
{{WoW API}}

Revision as of 17:26, 6 January 2007

WoW API < GetTradeSkillInfo

GetTradeSkillInfo - Documentation edited by wowpendium.de

Synopsis

Retrieves information about a specific trade skill.

skillName, skillType, numAvailable, isExpanded = GetTradeSkillInfo(skillIndex)

Arguments

(skillIndex)
skillIndex
Number - The id of the skill you want to query.

Returns

skillName, skillType, numAvailable, isExpanded
skillName
String - The name of the skill, e.g. "Copper Breastplate" or "Daggers", if the skillIndex references to a heading.
skillType
String - Either "header", if the skillIndex references to a heading, or a string indicating the difficulty to craft the item ("trivial", "easy", "medium", "optimal", "difficult").
numAvailable
Number - The number of items the player can craft with his available trade goods.
isExpanded
Boolean - Returns if the header of the skillIndex is expanded in the crafting window or not

Example

local tradeSkillsNum;
local name, type;
for i=1,GetNumTradeSkills() do
   name, type, _, _ = GetTradeSkillInfo(i);
   if (type ~= "header") then
      DEFAULT_CHAT_FRAME:AddMessage("Found: "..name);
   end
end

Result

Displays all items the player is able to craft in the chat windows.

Details

Retrieves the name of the skill, the type of the skill and the amount the player can craft for a specific crafting skill.