Created
December 12, 2014 03:57
-
-
Save mkb/ea429a1e2d78fb602f94 to your computer and use it in GitHub Desktop.
Return mana percentage in combat or if less than 100%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() | |
local mana = math.max(0, UnitMana("player")); | |
local max = math.max(1, UnitManaMax("player")); | |
local p = math.floor(mana / max * 100) | |
if UnitAffectingCombat("player") or p < 100 then | |
return string.format("%.f", p); | |
else | |
return "" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment