View Single Post
02-02-19, 09:12 PM   #6
Nightness
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Feb 2009
Posts: 32
Originally Posted by Fizzlemizz View Post
Do you mean something like:
Lua Code:
  1. local button = CreateFrame('Button', 'ExitButton', nil, "InsecureActionButtonTemplate, UIPanelButtonTemplate")
  2. button:SetText("Logout")
  3. button:SetAttribute('type', 'macro')
  4. button:SetPoint("CENTER")
  5. button:SetSize(60, 24)
  6. SLASH_MCR1 = "/mcr"
  7. SlashCmdList["MCR"] = function(msg)
  8.     button:SetAttribute('macrotext', string.gsub(msg, '\92n', '\n'))
  9.     print(button:GetAttribute('macrotext'))
  10. end

Slash:
Code:
/mcr /cleartarget\n/stopcasting\n/script ToggleGameMenu(); StaticPopup1:Hide()
I might not be understanding properly what you are trying to achieve.
The gsub worked perfectly, thanks!!!
  Reply With Quote