Changes the item used for dynamic feedback for a macro. Normally a macro uses the item or spell specified by its commands to provide dynamic feedback when placed on an action button (through the Action APIs, e.g. IsActionUsable()
): e.g. if the macro uses a consumable item, the button will show the number of items remaining; if the macro uses an item with a cooldown, the button will show the state of the cooldown. This function allows overriding the item or spell used by the macro with another item -- the given item's state will be used for such feedback instead of the item or spell used by the macro.
See also Macro functions, Item functions.
Signature:
SetMacroItem(index,
"item"
[,
target])
or
SetMacroItem("name",
"item"
[,
target])
Arguments:
index
- Index of a macro (number
, macroID)name
- Name of a macro (string
)item
- Name of an item to use for the macro (string
)target
- A unit to use as target of the item (affects the macro's range indicator) (unitid
)
Examples:
-- Create a macro and note the index (19 - 36 are the character specific indices) -- Target a friendly item that you can bandage -- Set the first argument to the macro index -- Set the second argument to the name of a a bandage you have in your inventory SetMacroItem(19, "Heavy Runecloth Bandage", "target") -- The given macro on your action bars should now use the bandage range -- in order to indicate whether or not the macro is "in range"