Lore archive · Warcraft Wiki, 2023 dump
API RunMacroText
Last wiki revision 2023-08-24
Executes a string as if it was a macro. RunMacroText(macro)
- macro: - the string is interpreted as a macro and then executed
This creates an invisible button in the middle of the screen, that prints Hello World! every time it is clicked with the left button. -- Create the macro to use local myMacro = [=[ /run print("Hello") /run print("World!") ]=] -- Create the secure frame to activate the macro local frame = CreateFrame("Button", nil, UIParent, "SecureActionButtonTemplate"); frame:SetPoint("CENTER") frame:SetSize(100, 100); frame:SetAttribute("type", "macro") frame:SetAttribute("macrotext", myMacro); frame:RegisterForClicks("LeftButtonUp");
- Macros are executed via the client repeatedly firing the event.
- The maximum macro length via this method is 1023 characters
Source
https://warcraft.wiki.gg/wiki/API_RunMacroText · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.