WoW:API PickupContainerItem: Difference between revisions
Jump to navigation
Jump to search
PickupContainerItem -Documentation by Xenoveritas-
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> | <!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> | ||
PickupContainerItem( | PickupContainerItem(bagID, slot); | ||
<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section --> | <!-- Describe the purpose of the function, though exhausting detail can be saved for a later section --> | ||
| Line 13: | Line 13: | ||
<!-- List each argument, together with its type --> | <!-- List each argument, together with its type --> | ||
:( | :(bagID, slot) | ||
:; | :;[[API TYPE bagID|bagID]]: Integer - the integer ID bag the item is being taken from | ||
:;slot : Integer - the slot number (1-based) of the item | :;slot : Integer - the slot number (1-based) of the item | ||
Revision as of 00:08, 15 March 2006
PickupContainerItem(bagID, slot);
"Picks up" an item in one of the backpacks. This appears to be a kind of catch-all "pick up/activate" function.
- Arguments
- (bagID, slot)
- bagID
- Integer - the integer ID bag the item is being taken from
- slot
- Integer - the slot number (1-based) of the item
- Returns
- Nothing.
- Details
- "Picks up" an item in one of the backpacks. This appears to be a kind of catch-all "pick up/activate" function.
- If you have nothing else active, calling this will "pick up" the item, causing the cursor to change to the item's icon. Once this has happened, calling this a second time will swap the two items. Likewise, calling this when an ability that targets an item is active (for example, enchanting), then this function will "cast" that ability on the targetted item.
The following code will not work
PickupContainerItem(0,1) PickupContainerItem(0,2) PickupContainerItem(0,2) PickupContainerItem(0,3)
but
this one will work
PickupContainerItem(0,1) PickupContainerItem(0,2) PickupContainerItem(0,3) PickupContainerItem(0,4)
Trying to pickup the same item twice in the same "time tick" does not work. To get around the problem, you need to use an _OnUpdate function, check that at least .1 time has elapsed since the last time before picking up the same item.