Jump to content

Photo

[MACRO] Arena123 on nameplates

macro arena123 nameplates

  • Please log in to reply
1 reply to this topic

#1 Spyrö

Spyrö
  • Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 205
  • Talents: Shadow 0/1/1/1/0/0/0
  • LocationSpain

Posted 28 September 2015 - 11:15 PM

[MACRO] Arena123 on nameplates

Option 1: One macro
/run C_Timer.NewTicker(.2,function()for A,P in pairs({WorldFrame:GetChildren()})do A=P.ArtContainer if A then for i=1,5 do if P.NameContainer.NameText:GetText()==GetUnitName("arena"..i)then A.LevelText:SetText(i)break end end end end end)
Result:
Posted Image


Option 2: Two macros. Same with combat tracking (different color for nameplates of players out of combat)
-- Macro 1
/run PPrOc=function(N,B,L)local c=1 for i=1,5 do if N==GetUnitName("arena"..i)then c=UnitAffectingCombat("arena"..i)and 1 or 0 L:SetText(i)break end end B:SetVertexColor(c,1,c)end

-- Macro 2
/run C_Timer.NewTicker(.2,function()for A,P in pairs({WorldFrame:GetChildren()})do A=P.ArtContainer if A and P:IsVisible()then PPrOc(P.NameContainer.NameText:GetText(),A.Border,A.LevelText)end end end)
Result:
Posted Image


Option 3: Two macros highly optimized for performance, faster and much less CPU consuming, no combat tracking
-- Macro 1
/run WorldFrame.PpRc=function(P)P:HookScript("OnShow",function(P)for i=1,5 do if P.NameContainer.NameText:GetText()==P.gUnaMe("arena"..i)then P.ArtContainer.LevelText:SetText(i)break end end end)end

-- Macro 2
/run local W=WorldFrame;W.nC=-1;W:HookScript("OnUpdate",function(s)if s.nC~=s:GetNumChildren()then s.nC=s:GetNumChildren()for _,P in pairs({s:GetChildren()})do if P.ArtContainer and not P.gUnaMe then P.gUnaMe=GetUnitName;s.PpRc(P)end end end end)
Result:
Same as option 1


I have created this for "no addons just macros" diehards. If you use addons ArenaPlates is a much better option (much less CPU consuming than the macros, more features, and configurable with an UI panel).
  • 2

#2

Posted 29 September 2015 - 06:55 PM

+Rep. Thank you :)
  • 0





Also tagged with one or more of these keywords: macro, arena123, nameplates

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<