WoW:API PickupContainerItem

From AddOn Studio
Revision as of 00:08, 15 March 2006 by WoWWiki>Ebnusn
Jump to navigation Jump to search
PickupContainerItem -Documentation by Xenoveritas-


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.


Template:WoW API