View Single Post
11-01-08, 12:19 AM   #1
HyperGig
A Cyclonian
Join Date: Jan 2008
Posts: 46
StatusBar Time Best Practice?

I'm new to making teh mods and i have a best practice question.

I have a StatusBar that i would like to use to keep track of a particular buff and i was wondering what the best way to do this is? Originally i was doing something like this...

Code:
               
local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable =UnitBuff("target",i)
local bar = getglobal("Form".."StatusBar1");
local left = (expirationTime - (time()-1225488545)) / duration; 
bar:SetValue(left);
..and stuck this function in the <OnUpdate> tags in the xml.

This can't be the best way to do this right? Like there is some sort of built in thing-a-ma-jig that does times and durations for you?

Thanks in advanced
  Reply With Quote