Hey there,
As the title suggests, I'm looking for some help with some custom LUA coding for Stuf Unit Frames. I'll try to be as specific as I can be while trying this at 5:45am.
What I'm trying to do is have my power bar display a percentage for any class that uses mana and a flat number for everything else (ie. energy, rage, runic power, focus, etc.)
I've spent a couple hours researching the UnitPower LUA stuff, but I just couldn't get it to work. Here's the code I have so far:
Code:
function(unit, cache, textframe)
if UnitPowerType("player") == 0 then
local z = math.max(0, UnitPower("player")) / math.max(1, UnitPowerMax("player")) * 100;
return string.format("%.f", z) .. "%%";
else return UnitPower("player") end
Any help would be greatly appreciated.