WoW:API PickupInventoryItem: Difference between revisions

m
Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect
mNo edit summary
m (Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
PickupInventoryItem(index)<br>
PickupInventoryItem(slotId)
Where index is a number refering to a slot in the character's equipment<br>
<br>
1 = head<br>
2 = neck<br>
3 = shoulder<br>
4 = shirt<br>
5 = chest<br>
6 = belt<br>
7 = legs<br>
8 = feet<br>
9 = wrist<br>
10 = gloves<br>
11 = finger 1<br>
12 = finger 2<br>
13 = trinket 1<br>
14 = trinket 2<br>
15 = back<br>
16 = main hand<br>
17 = off hand<br>
18 = ranged<br>


[[Category:API Functions|PickupInventoryItem]]
"Picks up" an item from the player's worn inventory. This appears to be a kind of catch-all "pick up/activate" function.
[[Category:API Cursor Functions|PickupInventoryItem]]
 
[[Category:API Inventory Functions|PickupInventoryItem]]
----
;''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