Thread: Stuf texts
View Single Post
01-20-13, 10:06 PM   #4
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
I can't say I entirely understand what these tags are supposed to do, but I tried.

Code:
function(unit, cache, textframe)
if (UnitAffectingCombat("player")) then
  if (cache.perchp<99) then
    return string.format("%d%%%% > %d",cache.perchp,cache.percmp);
  else
    return string.format("%d > %d",cache.curhp,cache.percmp);
  end
end
end
This is what this code will do as custom lua:

When at or above 99% HP while in combat:
Code:
[Actual HP] > [Percent MP]
When below 99% HP while in combat:
Code:
[Percent HP]% > [Percent MP]
And to make it display only on mouseover, just enable the check "Show Only on Mouseover" under the "Frequent Updates" checkmark.

I think that this is what you wanted it to do? If not please let me know!



Just a note: string.format("%d%% > %d",percentHp,percentMp); just kept giving me a format error for stuf, didn't want to look into it so I just did a nice string combine lol...
Edit: Finally figured out for the string.format, needed an extra escaped % so it could go through Stuf's formatting, thus the 4 %'s... lol.

Last edited by Waky : 01-21-13 at 04:07 PM.
  Reply With Quote