Quantcast Stuf texts - WoWInterface
Thread Tools Display Modes
01-16-13, 11:24 PM   #1
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Stuf texts

Needed some help with a Stuf tag..

Code:
[hpthreshold_if_hp99:perchp][hpthreshold_if_hp99:%][custom_ifnot_hp99:curhp]  [custom:>][power:>]  [power:percmp]
I have that set up perfectly (for me) but I would like to see it only in combat or mouse over. Stuf has an option to only show on mouseover, but I'm lost trying to only get this to show up in combat.
Tl;Dr: Just want to see this tag in combat or mouseover. My thanks, for any/all help~
__________________
  Reply With Quote
01-17-13, 10:01 PM   #2
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
I just read that again, I must have been REALLY tired when I posted that.
Same question, posed a better, more concise way: Would anyone care to help me turn that existing tag into the exact same tag, but only see it in combat AND mouse over?
__________________
  Reply With Quote
01-19-13, 11:24 PM   #3
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Ah well, just hoped someone knew. My thanks for your time~
__________________
  Reply With Quote
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
01-23-13, 03:16 PM   #5
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Waky was kind enough to work on this and send it to me in a pm, wanted to post the end product, to show appreciation for his time and effort, this text string is pure coolness~

Code:
function(unit, cache, textframe)
if (UnitAffectingCombat("player") or GetMouseFocus():GetName()==("Stuf.units."..unit)) 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
You'll have to check both frequent updates and show only on mouse over for this to work.
__________________

Last edited by Kendian : 01-23-13 at 03:18 PM. Reason: spellcheck
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Stuf texts

Thread Tools
Display Modes

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