Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-28-10, 07:04 AM   #1
Lane
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 36
Lua help UnitDebuff

I'm trying to calculate the time remaining for a specific debuff. I'm not getting any errors but I think my lack of lua Math and Rounding is causing a nonsensical return.

Given:
Code:
local function getSpellTime(spell)
	local name, _, _, _, _, dur, exp, caster = UnitDebuff("target", spell)
	if name ~= nil and caster == "player" and name == spell then
		return exp - GetTime();
	end
end
My return value is usually something like 2... or 4...

Any idea what I need to get whole second times?
 
 

WoWInterface » AddOns, Compilations, Macros » Cataclysm Beta » Lua help UnitDebuff


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off