Quantcast
WoWInterface - View Single Post - Spell ID mouseover macro ... or something like that
View Single Post
09-16-15, 04:22 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, you really don't need half those variables you're defining... if you're only going to use a value once, just use it. You don't need to assign one variable's value to another variable before you can use it. I'm also extremely confused about the logic behind doing "-1 * (x - y)" instead of just "y - x" when that's what you really want... o_O

Code:
	for i = 1, 40 do
		local _,_,_,_,_,_,expirationTime,_,_,_id = UnitBuff(u, i)
		if id == 20925 then
			local timeLeft = expirationTime - GetTime()
			if timeLeft > 0.5 then
				return format("|cfffdff52%.0f|r", timeLeft)
			end
		elseif not id then
			-- no more buffs to look at
			return
		end
	end
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote