Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TransferBetweenBackpacks

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Asks the server to move an item out of the backpack it is in, without choosing a destination slot.

TransferBetweenBackpacks(slot, backpackType)

Arguments

slot
number – Slot of the item inside the backpack, starting at 1.
backpackType
number – Which backpack the item is in, as an EA_Window_Backpack.TYPE_* value: 2 (TYPE_INVENTORY), 3 (TYPE_CURRENCY) or 4 (TYPE_CRAFTING).

Returns

Nothing.

Details

  • The client sends a move request for the item with a fixed special destination instead of a slot. Where the item ends up is decided by the server.
  • slot is truncated to its low byte (0–255). For backpackType 2, 3 and 4 it is converted to an absolute inventory slot; for any other value it is used without conversion.
  • The client does not check that the slot holds an item.
  • The stock backpack window calls it for crafting and currency items, passing the backpack currently shown.
  • The function needs at least two arguments and only reads the last two.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

From default/ea_backpackwindow/source/backpackutils.lua:

elseif ( isTradeSkillItem or isCurrencyItem )
then
    TransferBetweenBackpacks( slot, EA_Window_Backpack.currentMode )

See also