WoW:API PickupInventoryItem: Difference between revisions

m
Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect
m ("Picks up" an item from the player's worn inventory.)
m (Move page script moved page API PickupInventoryItem to WoW:API PickupInventoryItem without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  PickupInventoryItem(slotId)
  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.
"Picks up" an item from the player's worn inventory. This appears to be a kind of catch-all "pick up/activate" function.


----
----
Line 23: Line 23:
:You can use [[API GetInventorySlotInfo|GetInventorySlotInfo]] to get the slotId:
:You can use [[API GetInventorySlotInfo|GetInventorySlotInfo]] to get the slotId:


<table cellpadding="1" align="center">
 
<tr><td>GetInventorySlotInfo()</td><td>slotId</td></tr>
{| cellpadding="1" align="center"
<tr><td>AmmoSlot</td><td>0</td></tr>
|-----
<tr><td>HeadSlot</td><td>1</td></tr>
| GetInventorySlotInfo() || slotId
<tr><td>NeckSlot</td><td>2</td></tr>
|-----
<tr><td>ShoulderSlot</td><td>3</td></tr>
| AmmoSlot || 0
<tr><td>ShirtSlot</td><td>4</td></tr>
|-----
<tr><td>ChestSlot</td><td>5</td></tr>
| HeadSlot || 1
<tr><td>WaistSlot</td><td>6</td></tr>
|-----
<tr><td>LegsSlot</td><td>7</td></tr>
| NeckSlot || 2
<tr><td>FeetSlot</td><td>8</td></tr>
|-----
<tr><td>WristSlot</td><td>9</td></tr>
| ShoulderSlot || 3
<tr><td>HandsSlot</td><td>10</td></tr>
|-----
<tr><td>Finger0Slot</td><td>11</td></tr>
| ShirtSlot || 4
<tr><td>Finger1Slot</td><td>12</td></tr>
|-----
<tr><td>Trinket0Slot</td><td>13</td></tr>
| ChestSlot || 5
<tr><td>Trinket1Slot</td><td>14</td></tr>
|-----
<tr><td>BackSlot</td><td>15</td></tr>
| WaistSlot || 6
<tr><td>MainHandSlot</td><td>16</td></tr>
|-----
<tr><td>SecondaryHandSlot</td><td>17</td></tr>
| LegsSlot || 7
<tr><td>RangedSlot</td><td>18</td></tr>
|-----
<tr><td>TabardSlot</td><td>19</td></tr>
| FeetSlot || 8
<tr><td>Bag0Slot</td><td>20</td></tr>
|-----
<tr><td>Bag1Slot</td><td>21</td></tr>
| WristSlot || 9
<tr><td>Bag2Slot</td><td>22</td></tr>
|-----
<tr><td>Bag3Slot</td><td>23</td></tr>
| HandsSlot || 10
</table>
|-----
| 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
|}


----
----
Line 57: Line 83:
  /script PickupInventoryItem(GetInventorySlotInfo("SecondaryHandSlot"))
  /script PickupInventoryItem(GetInventorySlotInfo("SecondaryHandSlot"))


The above attempts a main-offhand weapon swap. It will pick up the weapon from main hand and then pick up the weapon from offhand, attempting to equip the main-hand weapon to off-hand and sending the off-hand to main-hand if possible.
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}}
{{wowapi}}
Anonymous user