Debuff Timer Frame
Well someone asked to script an add on that would display the remaining time on an enem debuff. For example if he casted Fearie Fire on a mob, he would have liked to know how much time was left on Fearie Fire. I came up with this script, which is a total failure, but no one tells me why... Searching for help!
function Debuff_Timer_Load()
this:RegisterEvent("VARIABLES_LOADED")
end
function Debuff1_start()
local sec == GetTime()
local TimeSinceStart == 0
local BuffTime == X
local BuffTime - TimeSinceStart == TimeElapsed
DebuffFrame1:Show()
while (i~=0) GetTime() - sec = OneSecondGap if (OneSecondGap == 1) then
TimeSinceStart = TimeSinceStart + 1 sec = sec + 1
elseif TimeSinceStart == BuffTime then break;
end
end
This will never work but hell :P
Now for the FrameXML
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Frame name="DebuffFrame1">
<Size><AbsDimension x="20" y="100"/></Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Frame>
<Frame name="DebuffFrame1">
<Scripts>
<OnShow>
message(TimeElapsed);
</OnShow>
</Scripts>
</Frame>
</Ui>
The debuff1_start() needs to be called from a macro. So your macro should look like this
/script CastSpellByName("whateva(rank ##)") Debuff_start()
And X is the time in seconds of the debuff.
|