API PickupInventoryItem

PickupInventoryItem(slotId)

"Picks up" an item from the player's worn inventory. This appears to be a kind of catch-all "pick up/activate" function.


 * Arguments


 * slotId
 * slotId : Numeric - the slot ID of the worn inventory slot.


 * Returns


 * Nothing.


 * Details


 * If the cursor is empty, then it will attempt to pick up the item in the slotId.
 * If the cursor has an item, then it will attempt to equip the item to the slotId and place the previous slotId item (if any) where the item on cursor orginated.
 * If the cursor is in repair or spell-casting mode, it will attempt the action on the slotId.
 * You can use GetInventorySlotInfo to get the slotId:


 * Example

/script PickupInventoryItem(GetInventorySlotInfo("MainHandSlot")) /script PickupInventoryItem(GetInventorySlotInfo("SecondaryHandSlot"))

The above attempts a main hand/off-hand weapon swap. It will pick up the weapon from the main hand and then pick up the weapon from the off-hand, attempting to equip the main hand weapon to off-hand and sending the off-hand to main hand if possible.