Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Executes a string as if it was a macro.

RunMacroText(macro)

Arguments[]

macro
string - the string is interpreted as a macro and then executed

Example[]

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");

Details[]

  • Macros are executed via the client repeatedly firing the EXECUTE_CHAT_LINE event.
  • The maximum macro length via this method is 1023 characters

Patch changes[]

Bc icon Patch 2.0.1 (2006-12-05): Protected.

Advertisement