WoW:Item equipping

From AddOn Studio
Revision as of 01:11, 18 November 2004 by WoWWiki>Sarf (→‎Multiple commands)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basics

/script PickupContainerItem(bag, slot)

The basic command. Works like this:

  • If no item in cursor:
    • If item in bag:slot - picks up the item and puts it on the cursor.
    • If no item in bag:slot - does nothing
  • If item on cursor
    • If item in bag:slot - switches the item in the bag:slot with the one on the cursor.
    • If no item in bag:slot - puts down item from cursor into bag:slot

/script PickupInventoryItem(inventorySlot)

Picks up/puts down/switches item into the specified slot.

See InventorySlots for ids and mappings.

Multiple commands

There is a problem when executing multiple Pickup commands because they execute instantaneously on your client, which is not always synched with the server.

Therefore, follow these simple guidelines:

  1. Check if the cursor has an item on it and execute all your pickup commands on the same line.
    Example:
    if ( not CursorHasItem() ) then PickupContainerItem(...); ... end
  2. Pickup items once, and drop them once for one macro.

Good luck!