Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:AutoEquipItem

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Asks the server to equip an item from the main inventory backpack.

AutoEquipItem(inventorySlot)

Arguments

inventorySlot
number – Slot of the item in the main inventory backpack, starting at 1.

Returns

Nothing.

Details

  • Sends a move request for the item in that slot. No equipment slot is given: the request uses a fixed "equip" destination instead of a specific slot.
  • While the client's inventory lock flag is set, nothing is sent. The same flag blocks moves to and from equipment in RequestMoveItem.
  • The client does not check that the slot holds an item or that the item can be equipped.
  • Exactly one argument must be passed.

Errors

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

Example

From default/ea_characterwindow/source/characterwindow.lua:

function CharacterWindow.DialogAutoEquip()
    if( CharacterWindow.slotToEquip )
    then
        AutoEquipItem( CharacterWindow.slotToEquip )
        CharacterWindow.slotToEquip = nil
    end
end

See also