Stuf + Threat + Power Text
I am currently wanting to make a small threat meter using Stuf's custom LUA text option.
All I want it to do is just show My current Threat% (without the % sign please) on my target, the color being Stuf's HP Red Color. If someone could offer assistance, I would appreciate it greatly! *~Lily.Petal~* =============== For anyone who happens to search for similar effects for their own layouts, code will be listed below. Link for other lua codes(provided by Cantises): Lua Stuf examples This code makes your power into a percent(without the %); if you are using energy/mana, the text will only show if you are under 100% (otherwise hidden). If you use RunicPower or Rage, the text will not show up unless you are above 1%. Code:
function(unit) Code:
function(unit) |
Quote:
Code:
self.ttelapsed = 0 |
Quote:
|
Quote:
|
LuaTexts can be set to run (a slightly throttled, iirc) OnUpdate if you check the "frequent updates" box.
|
Quote:
Code:
local _, _, threatpct, _, threatvalue = UnitDetailedThreatSituation(unitid, mobunitid) |
Quote:
Do I need to change unitid to player? |
Quote:
unitid = "player" mobunitid = "target" |
If you put it in as a LuaText for your player frame, it will pass your "player" unitid to the function as the first(?) argument.
|
Thank you Nib and Seerah, was great help!
Hm having a different problem now, with all my classes I use: Quote:
Is there someway that I can have it show Quote:
Quote:
|
Quote:
Code:
local _, power_token = UnitPowerType(unit) -- Lua Texts usually pass the unit arg, so leaving unit as is should work |
Quote:
Quote:
|
Hm, using stuf it says when I switch to LUA:
Quote:
Quote:
|
What is it you're trying to achieve, exactly? Just showing the Power in standard format?
|
Quote:
And the opposite if they do use said powertypes, where if it's at 0% said text will hide. Basically: if power≤99% show if not DK/Bear/Warrior as CurMP% and if power≥1% show if DK/Bear/Warrior as CurMP% Does this help? :< EDIT: it's just REALLY annoying when I'm playing my DK/Warrior that I see a 0 in the middle of my power bar when I have no power at all. |
Quote:
Barebones: Code:
local _, pToken = UnitPowerType(unit) |
Do I still need to do something with:
Quote:
Quote:
EDIT: let me try changing unit to "player" EDIT2: ugh Dx darn you stuf... darn you... (didn't work) |
Hmm, same error again? It must behave different to Pitbull's Lua Text. Maybe it needs an extra return.
Code:
local _, pToken = UnitPowerType(unit) |
Well it's not giving me an error, it's just not showing up at all. I don't really understand it.
|
Quote:
Code:
local _, pToken = UnitPowerType(unit) |
All times are GMT -6. The time now is 07:46 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI