API:AddCraftingContainer
From RoR Wiki
UI Lua API · Crafting functions
Version: WAR 1.4.8
Asks the server to use an item from a backpack as the container of a crafting session (talisman making or apothecary).
AddCraftingContainer(tradeSkill, backpackSlot, backpackType)
Arguments
- tradeSkill
number– AGameData.TradeSkillsvalue:APOTHECARY(4) orTALISMAN(5).- backpackSlot
number– Slot of the container item inside the backpack, starting at 1.- backpackType
number– Which backpack the item is in, as anEA_Window_Backpack.TYPE_*value (2 = inventory, 3 = currency, 4 = crafting).
Returns
Nothing.
Details
backpackSlotandbackpackTypeare converted to an absolute inventory slot.- With trade skill 4 or 5 the client sends a crafting "add container" request for that skill. With any other value it sends the same message type without a crafting command.
- If a certain player state flag is set, the client adds a fixed message to the
Chattext log instead of sending the request. - The function needs at least three arguments and only reads the last three.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
From default/ea_craftingwindow/source/apothecarywindow.lua:
if( slotNum == ApothecaryWindow.SLOT_CONTAINER)
then
AddCraftingContainer( GameData.TradeSkills.APOTHECARY, backpackSlot, backpackType )
else
AddCraftingItem( GameData.TradeSkills.APOTHECARY, slotNum, backpackSlot, backpackType )
end
