Code:
local b1,b2 = "BT4Bar5", "BT4Bar6"
local function hook()
local s1,s2 = b1.SetAlpha,b2.SetAlpha
function b1:SetAlpha(v)
s1(b1,v)
s2(b2,v)
end
function b2:SetAlpha(v)
s1(b1,v)
s2(b2,v)
end
end
CreateFrame("Frame"):SetScript("OnUpdate", function(self)
local t1,t2 = (type(b1)=="string"),(type(b2)=="string")
if t1 and _G[b1] then
b1=_G[b1]
t1=false
end
if t2 and _G[b2] then
b2=_G[b2]
t2=false
end
if (not t1) and (not t2) then
self:Hide()
hook()
end
end)
I want to connect bar 5 and 6, and I received no errors in-game. Is it because I didn't have both addons faded out before I made the addon?