DeleteMacro

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.0.0 / 1.13.2

Deletes a macro.

DeleteMacro(indexOrName)

Arguments

The sole argument has two forms to identify which macro to delete.

indexOrName
number|string - Index ranging from 1 to 120 for account-wide macros and 121 to 138 for character-specific ones or name of the macro to delete.

Example

Deleting all global macros:

-- Start at the end, and move backward to first position (1).
for i = 0 + select(1,GetNumMacros()), 1, -1 do
	DeleteMacro(i)
end

Deleting all character-specific macros:

-- Start at the end, and move backward to first position (121).
for i = 120 + select(2,GetNumMacros()), 121, -1 do
	DeleteMacro(i)
end

Patch changes

Bc icon.gif Patch 2.0.1 (2006-12-05): Protected during combat,[1] but now also accepts a macro's name as an argument.[2]

See also

References