GetMacroItem

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 2.3.0

Returns information about the item a given macro is set to use.

itemName, itemLink = GetMacroItem(slot or macroName)

Arguments

Takes one argument, one of the below:

slot
number - The macro index to query.
macroName
string - The name of the macro to query.

Returns

itemName
string - The localized name of the item.
itemLink
string : ItemLink - The localized link of the item.

Example

local macroName = "MyMacro"
local index = GetMacroIndexByName(macroName)
if index then 
    local itemId, itemLink = GetMacroItem(index)
    if itemId then
        print("Item to use inside macro", itemId, itemLink)
    end
end