API:GetCraftRequestItem

__NOTOC__
Gets material information about a crafted item.
numRequestItem, requestTools, reqMoney = GetCraftRequestItem( GUID, -1 )
itemName, itemTexture, itemCount, itemTotalCount = GetCraftRequestItem( GUID, itemIndex )
== Parameters ==
=== Arguments ===
:;GUID
::number - unique identifier for the craft item (see GetCraftItem)
:;itemIndex
::number - index of the materials list, or -1 to see how many materials there are, etc
=== Returns ===
:;numRequestItem
::number - how many materials there are
:;requestTools
::string - string specifying what tools you need to be near to use this
:;reqMoney
::number - how much money you need to pay to make this item
OR
:;itemName
::string - name of the material at the specified index
:;itemTexture
::string - icon path
:;itemCount
::number - how many of the item you have
:;itemTotalCount
::number - how many of the item you need
== Example ==
local numSkills = GetCraftItemList()
if numSkills == 0 then return end
local numSubTypes = GetCraftSubType(1, -1)
if numSubTypes == 0 then return end
local numItem = GetCraftItem( 1, 1, -1 )
if numItem == 0 then return end
local GUID = GetCraftItem(1, 1, 1)
for i = 1, GetCraftRequestItem(GUID, -1) do
 local name = GetCraftRequestItem(GUID, i)
 ...
end
== Notes ==
The GUID can also be found by using ParseHyperlink and the link to a recipe. The GUID will be the second returned value, but it must be converted from a hexadecimal number to a decimal number. Note that material lists will only be returned by GetCraftRequestItem if your character has learned the recipe, otherwise it will return nil.
Category:Functions