Snack
Salty
So I have been using a couple of scripts for arena frames + PvP trinket tracking. I just learned about making your own AddOns; creating lua files so the scripts load upon login, and I have been messing around with it. I got a couple of scripts working, but the one for arena frames/PvP trinket is anoying me.
Here are my scripts taken from my ingame macro menu:
These sets the position of the frames and scales them up:
These are for PvP trinkets:
and this is my AddOn (which isn't working):
I have no idea what I am doing wrong, it does show the PvP trinkets, but doesn't scale/move arena frames. Any help would be greatly appreciated!
Here are my scripts taken from my ingame macro menu:
These sets the position of the frames and scales them up:
Code:
/run TR="TOPRIGHT" ArenaEnemyFrame1:ClearAllPoints() ArenaEnemyFrame2:ClearAllPoints() ArenaEnemyFrame1:SetPoint(TR,-150,-40) ArenaEnemyFrame2:SetPoint(TR,-150,-90)
/run ArenaEnemyFrame1.SetPoint = function() end ArenaEnemyFrame2.SetPoint = function() end
/run ArenaEnemyFrame1:SetScale(1.4)
/run ArenaEnemyFrame2:SetScale(1.4)
These are for PvP trinkets:
Code:
/run rc=36;rfc=CooldownFrame_SetTimer;aef="ArenaEnemyFrame";hb="HealthBar";trt=GetItemIcon(37864)ctf = CreateFrame;oe="ARENA_OPPONENT_UPDATE"ve="PLAYER_ENTERING_WORLD"tr="RIGHT"LoadAddOn("Blizzard_ArenaUI")
/run function Cr(i)local f=ctf("Frame",nil,UIParent)f:SetPoint(tr,_G[aef..i..hb],tr,80,0)f:SetSize(rc,rc)f.t=f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.t:SetTexture(trt)f.c=CreateFrame("Cooldown",nil,f)f.c:SetAllPoints(f)return f;end
/run function ur(f,i)f:SetScript("OnEvent",function(_,e,u,_,_,_,s)if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1)elseif(s==7744)then rfc(f.c,GetTime(),30,1)end end end)f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")end
/run for i=1,5 do _G["rf"..i]=Cr(i)local f=_G["rf"..i]ur(f,i)f:Hide()end function str(o,m)for i=1, 2 do local f=_G["rf"..i]if o then f:Show()else f:Hide()f.c:Hide()end end end
/run tk=ctf("Frame")tk:SetScript("OnEvent",function(_,e)if e==oe then str(1,GetNumArenaOpponents())else str(nil,5)end end)tk:RegisterEvent(oe)tk:RegisterEvent(ve)
Code:
TR="TOPRIGHT" ArenaEnemyFrame1:ClearAllPoints() ArenaEnemyFrame2:ClearAllPoints() ArenaEnemyFrame1:SetPoint(TR,-150,-40) ArenaEnemyFrame2:SetPoint(TR,-150,-90) end
ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame1:SetScale(1.4) end
ArenaEnemyFrame2:SetScale(1.4) end
rc=36;rfc=CooldownFrame_SetTimer;aef="ArenaEnemyFrame";hb="HealthBar";trt=GetItemIcon(37864)ctf = CreateFrame;oe="ARENA_OPPONENT_UPDATE"ve="PLAYER_ENTERING_WORLD"tr="RIGHT"LoadAddOn("Blizzard_ArenaUI")
function Cr(i)local f=ctf("Frame",nil,UIParent)f:SetPoint(tr,_G[aef..i..hb],tr,80,0)f:SetSize(rc,rc)f.t=f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.t:SetTexture(trt)f.c=CreateFrame("Cooldown",nil,f)f.c:SetAllPoints(f)return f;end
function ur(f,i)f:SetScript("OnEvent",function(_,e,u,_,_,_,s)if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1)elseif(s==7744)then rfc(f.c,GetTime(),30,1)end end end)f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")end
for i=1,5 do _G["rf"..i]=Cr(i)local f=_G["rf"..i]ur(f,i)f:Hide()end function str(o,m)for i=1, 2 do local f=_G["rf"..i]if o then f:Show()else f:Hide()f.c:Hide()end end end
tk=ctf("Frame")tk:SetScript("OnEvent",function(_,e)if e==oe then str(1,GetNumArenaOpponents())else str(nil,5)end end)tk:RegisterEvent(oe)tk:RegisterEvent(ve)
I have no idea what I am doing wrong, it does show the PvP trinkets, but doesn't scale/move arena frames. Any help would be greatly appreciated!