Thread: Target NPC
View Single Post
02-04-14, 03:27 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Getting easy-to-understand documentation on how to make a "secure" macro in Lua is not easy, so here we go:
Same macro as the one you provided, written in Lua

Lua Code:
  1. local button = CreateFrame("Button", "MyButton", UIParent, "SecureActionButtonTemplate")
  2. button:Hide()
  3. button:SetAttribute("type", "macro")
  4. button:SetAttribute("macrotext", "/target [@Kor'kron Warshaman,nodead] Kor'kron Warshaman; SetRaidTarget('target', 8)")

Now you can make a new macro (ingame) that does this:
Code:
/click MyButton
  Reply With Quote