WoW:API UseContainerItem: Difference between revisions

Redid page to follow the BoilerPlate, added onSelf, added more slot info
No edit summary
(Redid page to follow the BoilerPlate, added onSelf, added more slot info)
Line 1: Line 1:
<center>'''UseContainerItem''' ''-Documentation by [[user:The_Nerd_Wonder|The Nerd Wonder]]-''</center>
{{wowapi}} __NOTOC__
----
;''Arguments''
:;:(bagID,slot)
:::;[[API TYPE bagID|bagID]] : number - number of the bag the item is in.
:::;slot : number - slot number of the bag item you want the info for.


----
Use an item from a container. If Merchant window is open, this will sell the item.
*Using container items is basicaly the same as clicking on them with the mouse right-button. This means that if you are at a vendor, your scripts can sell unintended items or if a bank window is open the item may be put into the bank.


UseContainerItem(bagId, slot [, onSelf])


:Bags are listed from main backpack (original 16 slotter) left. Therefore if you were looking at the default bag row the bags would be numbered as such:
== Parameters ==
=== Arguments ===
:(bagId, slot [, onSelf])


::4, 3, 2, 1, 0
:;[[bagId]] : Integer - The bag id, where the item to use is located
:;slot : Integer - The slot in the bag, where the item to use is located
:;onSelf : Boolean - Optional parameter, if the item should be used on yourself (default: false).


:Moreover when the bank is opened, bank content and bank bag can be accessed with -1 and 5 to 10 as bagID.
== Example ==
UseContainerItem(1, 16, 1)


====Result====
:Uses the item located in the 16th slot in your 1st bag (not backpack) on yourself.
:For instance if it's a bandage, this will bandage yourself.


:Slots are listed from left to right, top to bottom.
==Details==
:Slots in the bags are listed from left to right, top to bottom.  
:A 16 slot bag have the following slot numbers:
::{| ! style="width: 150px; text-align: right; border: 1px solid white"
|-
| 1 || 2 || 3 || 4
|-
| 5 || 6 || 7 || 8
|-
| 9 || 10 || 11 || 12
|-
| 13 || 14 || 15 || 16
|}


::In the example of your main backback, the top row would be 1, 2, 3, 4. The bottom row would be 13, 14, 15, 16.
::In the example of a 6, 10, 14, or 18-slot bag (or any other bag with slots not divisible by 4), the top row is 1, 2 and the next row is 3, 4, 5, 6.  -''[[user:Kris|Kris]]'' on 4/8/2006


----
:An 18 slot bag have the following slot numbers:
;''Example''
::{| ! style="width: 150px; text-align: right; border: 1px solid white"
 
|-
UseContainerItem(0,6) would use an item in your main backback, second row down, one space to the right.
|  ||  || 1 || 2
 
|-
 
| 3 || 4 || 5 || 6  
----
|-
{{WoW API}}
| 7 || 8 || 9 || 10
|-
| 11 || 12 || 13 || 14
|-
| 15 || 16 || 17 || 18
|}
Anonymous user