Hey guys,
new to this place and also to LUA. I already asked this question in the official WoW Forums but no one seems to care.
Currently I am working on a Castbar Script that places a Cast Bar with a small border under my player/target/focus frame and changes color if it's not interruptable.
This is what I have so far:
Code:
--PlayerCastBar
CastingBarFrame:ClearAllPoints()
CastingBarFrame:SetPoint("Bottom",UIParent,"Bottom", -230, 150)
CastingBarFrame.SetPoint = function() end
CastingBarFrame:SetHeight(30)
CastingBarFrame:SetWidth(225)
CastingBarFrame:SetStatusBarColor(1,1,1)
CastingbarFrame.SetStatusBarColor = function() end
--NotWorking
CastingBarFrameText:ClearAllPoints()
CastingBarFrameText:SetPoint(Bottom,0,0)
CastingBarFrameText:SetFont(testFont, 12, "Outline")
CastingBarFrameBorder:SetTexture(nil)
CastingBarFrameFlash:SetTexture(nil)
--Timers
CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil);
CastingBarFrame.timer:SetFont(testFont,12,"OUTLINE");
CastingBarFrame.timer:SetPoint("TOP", CastingBarFrame, "BOTTOM", 0, 0);
CastingBarFrame.update = .1;
hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
if not self.timer then return end
if self.update and self.update < elapsed then
if self.casting then
self.timer:SetText(format("%2.1f/%1.1f", max(self.maxValue - self.value, 0), self.maxValue))
elseif self.channeling then
self.timer:SetText(format("%.1f", max(self.value, 0)))
else
self.timer:SetText("")
end
self.update = .1
else
self.update = self.update - elapsed
end
end)
My problems are:
1) The default WoW Border still shows up.
2) I don't have a clue on how to add a proper spell name and cast time to my bars.
3) I don't know how to create a border around the cast bar that sticks to it in case if have to adjust the cast bar position.
May seem like a dumb question but I have never learned a programming language before.
Cheers