Thread: Target NPC
View Single Post
02-08-14, 05:36 PM   #23
urbley
A Deviate Faerie Dragon
Join Date: Feb 2014
Posts: 10
Ok so I have a crude little frame with all my buttons on it and I have created a set of hidden buttons on the UI with my macrotext targetting code for each permutation of Nazgrim's adds. I can just type /click myButton and it's all good but I've set the frame buttons to use those buttons and nothing seems to happen :/ Any ideas? I'll give an example.

Lua Code:
  1. local targetSAButton = CreateFrame("Button", "targetSA", UIParent, "SecureActionButtonTemplate")
  2.     targetSAButton:Hide()
  3.     targetSAButton:SetAttribute("type", "macro")
  4.     targetSAButton:SetAttribute("macrotext", [[
  5. /cleartarget
  6. /tar [@Kor'kron Assassin, nodead] Kor'kron Assassin
  7. /script SetRaidTarget('target', 7)
  8. /cleartarget
  9. /tar [@Kor'kron Warshaman, nodead] Kor'kron Warshaman
  10. /script SetRaidTarget('target', 8)
  11. /rw Warshaman + Assassin]])
  12.  
  13. local saButton = CreateFrame("button", "NazAddsFrameSAButton", NazAddsFrame, "UIPanelButtonTemplate")
  14.     saButton:SetHeight(20)
  15.     saButton:SetWidth(40)
  16.     saButton:SetPoint("TOPLEFT", NazAddsFrame, "TOPLEFT", 12, -12)
  17.     saButton:SetText("S+A")
  18.     saButton:SetAttribute("type", "macro")
  19.     saButton:SetAttribute("macrotext", "/click targetSA")

I hope you're all having a more exciting Saturday night that I am

Last edited by urbley : 02-08-14 at 05:40 PM. Reason: LOL
  Reply With Quote