WoW:API PickupInventoryItem: Difference between revisions

m
Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect
(a few indexes for PickupInventoryItem(xx))
 
m (Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect)
 
(9 intermediate revisions by 9 users not shown)
Line 1: Line 1:
PickupInventoryItem(16) refers to MainHand weapon
PickupInventoryItem(slotId)
PickupInventoryItem(17) refers to Off-hand slot


[stub]
"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 [[API TYPE InventorySlotID|slot ID]] of the worn inventory slot.
 
----
;''Returns''
 
<!-- List each return value, together with its type -->
: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 [[API GetInventorySlotInfo|GetInventorySlotInfo]] to get the slotId:
 
 
{| cellpadding="1" align="center"
|-----
| GetInventorySlotInfo() || slotId
|-----
| AmmoSlot || 0
|-----
| HeadSlot || 1
|-----
| NeckSlot || 2
|-----
| ShoulderSlot || 3
|-----
| ShirtSlot || 4
|-----
| ChestSlot || 5
|-----
| WaistSlot || 6
|-----
| LegsSlot || 7
|-----
| FeetSlot || 8
|-----
| WristSlot || 9
|-----
| HandsSlot || 10
|-----
| Finger0Slot || 11
|-----
| Finger1Slot || 12
|-----
| Trinket0Slot || 13
|-----
| Trinket1Slot || 14
|-----
| BackSlot || 15
|-----
| MainHandSlot || 16
|-----
| SecondaryHandSlot || 17
|-----
| RangedSlot || 18
|-----
| TabardSlot || 19
|-----
| Bag0Slot || 20
|-----
| Bag1Slot || 21
|-----
| Bag2Slot || 22
|-----
| Bag3Slot || 23
|}
 
----
;''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.
 
----
{{wowapi}}
Anonymous user