<?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%3AGetCraftingData</id>
	<title>API:GetCraftingData - 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%3AGetCraftingData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetCraftingData&amp;action=history"/>
	<updated>2026-10-17T12:05:22Z</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:GetCraftingData&amp;diff=30366&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:GetCraftingData&amp;diff=30366&amp;oldid=prev"/>
		<updated>2026-10-16T19:43:26Z</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=Crafting}}&lt;br /&gt;
Returns the items currently placed in the crafting window of a trade skill.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
craftingItems = GetCraftingData(tradeSkill)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;tradeSkill : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – A &amp;lt;code&amp;gt;GameData.TradeSkills&amp;lt;/code&amp;gt; value. The stock UI uses &amp;lt;code&amp;gt;APOTHECARY&amp;lt;/code&amp;gt; (4) and &amp;lt;code&amp;gt;TALISMAN&amp;lt;/code&amp;gt; (5).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;craftingItems : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of 8 [[API:GetInventoryItemData#Item data table|item data tables]], indexed by crafting slot from &amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039; to 7.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The indexes start at 0, not 1. &amp;lt;code&amp;gt;ipairs&amp;lt;/code&amp;gt; skips entry 0; use a numeric &amp;lt;code&amp;gt;for&amp;lt;/code&amp;gt; loop from 0 as the stock UI does.&lt;br /&gt;
* All 8 entries are always present. A crafting slot without an item gets a table with default values (&amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; 0).&lt;br /&gt;
* Nothing is returned for trade skill 0 or 7. Other values are not range-checked, so only pass real trade skill values. Nothing is returned either if there is no player object or the Lua state is not available.&lt;br /&gt;
* The stock crafting windows call it from their crafting status update handlers, together with [[API:GetCraftingBackPackSlots|GetCraftingBackPackSlots]].&lt;br /&gt;
* Exactly one argument must be passed.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when the argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_craftingwindow/source/talismanmakingwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function TalismanMakingWindow.UpdateCraftingStatus( updatedIngredients )&lt;br /&gt;
    ...&lt;br /&gt;
    local craftingData = GetCraftingData( GameData.TradeSkills.TALISMAN )&lt;br /&gt;
    local backpackSlots = GetCraftingBackPackSlots( GameData.TradeSkills.TALISMAN )&lt;br /&gt;
    ...&lt;br /&gt;
    for index = 0, TalismanMakingWindow.maxResources&lt;br /&gt;
    do&lt;br /&gt;
        if( not backpackSlots[index] )&lt;br /&gt;
        then&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
        local backpackSlot = backpackSlots[index].slot&lt;br /&gt;
        local backpackType = backpackSlots[index].backpack&lt;br /&gt;
&lt;br /&gt;
        local currentItem = craftingData[index]&lt;br /&gt;
        local validItem = currentItem.id ~= 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetCraftingBackPackSlots|GetCraftingBackPackSlots]]&lt;br /&gt;
* [[API:AddCraftingItem|AddCraftingItem]]&lt;br /&gt;
* [[API:PerformCrafting|PerformCrafting]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>