Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:RemoveCraftingItem

From RoR Wiki

UI Lua API · Crafting functions
Version: WAR 1.4.8

Asks the server to take an item back out of a crafting session.

RemoveCraftingItem(tradeSkill, backpackSlot, backpackType)

Arguments

tradeSkill
number – A GameData.TradeSkills value: APOTHECARY (4) or TALISMAN (5).
backpackSlot
number – Backpack slot the item came from, starting at 1.
backpackType
number – Which backpack that slot is in, as an EA_Window_Backpack.TYPE_* value (2 = inventory, 3 = currency, 4 = crafting).

Returns

Nothing.

Details

  • The item is identified by the backpack slot it came from, not by its crafting slot.
  • With trade skill 4 or 5, backpackSlot and backpackType are converted to an absolute inventory slot and the client sends a crafting "remove" request for that skill.
  • With trade skill 3 (cultivation) the client sends a cultivation request, without converting backpackSlot to an absolute slot. With any other value it sends the same message type without a crafting command. The stock UI only calls it for talisman making and apothecary.
  • If a certain player state flag is set, the client adds a fixed message to the Chat text 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/talismanmakingwindow.lua:

function TalismanMakingWindow.RemoveItem( backpackSlot, slotNum, backpackType )
    ...
    RemoveCraftingItem(GameData.TradeSkills.TALISMAN, backpackSlot, backpackType )
    Sound.Play( Sound.APOTHECARY_ITEM_REMOVED )
    TalismanMakingWindow.SetCraftingSlotIcon( slotNum, 0 )

See also