WoW:API GetTradeSkillInfo: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API GetTradeSkillInfo to API GetTradeSkillInfo without leaving a redirect) |
||
| (9 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} | |||
Retrieves | == Synopsis == | ||
Retrieves information about a specific trade skill. | |||
skillName, skillType, numAvailable, isExpanded = GetTradeSkillInfo(skillIndex) | skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps = GetTradeSkillInfo(skillIndex) | ||
== Arguments == | |||
(skillIndex) | |||
:;skillIndex : The id of the skill you want to query. | :;skillIndex : Number - The id of the skill you want to query. | ||
== Returns == | |||
skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps | |||
:;skillName : | :;skillName : String - The name of the skill, e.g. "Copper Breastplate" or "Daggers", if the skillIndex references to a heading. | ||
:;skillType : | :;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 : | :;numAvailable : Number - The number of items the player can craft with his available trade goods. | ||
:;isExpanded : | :;isExpanded : Boolean - Returns if the header of the skillIndex is expanded in the crafting window or not | ||
:;altVerb: String - If not nil, a verb other than "Create" which describes the trade skill action (i.e., for Enchanting, this returns "Enchant"). If nil the expected verb is "Create." | |||
:;numSkillUps: Number - The number of skill ups that the player can receive by crafting this item. | |||
---- | == Example == | ||
<!-- begin code --> | |||
local name, type; | local name, type; | ||
for i=1,GetNumTradeSkills() do | for i=1,GetNumTradeSkills() do | ||
name, type, _, _ = GetTradeSkillInfo(i); | name, type, _, _, _, _ = GetTradeSkillInfo(i); | ||
if (type ~= "header") then | if (name and type ~= "header") then | ||
DEFAULT_CHAT_FRAME:AddMessage("Found: "..name); | DEFAULT_CHAT_FRAME:AddMessage("Found: "..name); | ||
end | end | ||
end | end | ||
<!-- end code --> | |||
==== 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. | |||
Latest revision as of 04:46, 15 August 2023
Synopsis
Retrieves information about a specific trade skill.
skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps = GetTradeSkillInfo(skillIndex)
Arguments
(skillIndex)
- skillIndex
- Number - The id of the skill you want to query.
Returns
skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps
- 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
- altVerb
- String - If not nil, a verb other than "Create" which describes the trade skill action (i.e., for Enchanting, this returns "Enchant"). If nil the expected verb is "Create."
- numSkillUps
- Number - The number of skill ups that the player can receive by crafting this item.
Example
local name, type;
for i=1,GetNumTradeSkills() do
name, type, _, _, _, _ = GetTradeSkillInfo(i);
if (name and 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.