Hi guys
is there any addon or macro to display health and percentage like this :
128.000 / 128.000 (100%) ?
im searching since 2 days now and i almost give up because i really want this *_*
Health Numbers + Percentage?
Started by blackcherryx3, Dec 04 2012 06:32 PM
8 replies to this topic
#1
Posted 04 December 2012 - 06:32 PM
#2
Posted 04 December 2012 - 07:09 PM
FrameList = {"Player", "Target", "Focus"}
function UpdateHealthValues(...)
for i = 1, select("#", unpack(FrameList)) do
local FrameName = (select(i, unpack(FrameList)))
if UnitHealth(FrameName) < 1000 then
local Health = UnitHealth(FrameName)
local HealthMax = UnitHealthMax(FrameName)
else
local Health = (UnitHealth(FrameName))/1000
local HealthMax = (UnitHealthMax(FrameName))/1000
local HealthPercent = (UnitHealth(FrameName)/UnitHealthMax(FrameName))*100
if UnitHealth(FrameName) < 1000 then
_G[FrameName.."FrameHealthBar"].TextString:SetText(Health.." / "..HealthMax.." ("..format("%.0f",HealthPercent).."%)")
else
_G[FrameName.."FrameHealthBar"].TextString:SetText(format("%.0f",Health).."k / "..format("%.0f",HealthMax).."k ("..format("%.0f",HealthPercent).."%)")
end
end
end
end
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)
Though it won't show overall values, it shows it as 150k / 150k (100%)
If it was 150,000 / 150,000 (100%) it would be cluttered as hell anyways.
#3
Posted 04 December 2012 - 07:20 PM
Will it take long to LUA something like that?
#4
Posted 04 December 2012 - 07:36 PM
You can either use an addon called DevPad and paste that there, or use this: http://www.arenajunk...ult-ui-scripts/
at the very top Thaya explains how to make it into an addon.
at the very top Thaya explains how to make it into an addon.
#5
Posted 16 December 2012 - 09:23 AM
Is there a way to just show the actual health number without the total health beside it and percentage? ie: 150k / 100%?
Thanks
#6
Posted 16 December 2012 - 10:09 AM
just adjust the code above to:
should work
FrameList = {"Player", "Target", "Focus"}
function UpdateHealthValues(...)
for i = 1, select("#", unpack(FrameList)) do
local FrameName = (select(i, unpack(FrameList)))
if UnitHealth(FrameName) < 1000 then
local Health = UnitHealth(FrameName)
else
local Health = (UnitHealth(FrameName))/1000
local HealthPercent = (UnitHealth(FrameName)/UnitHealthMax(FrameName))*100
if UnitHealth(FrameName) < 1000 then
_G[FrameName.."FrameHealthBar"].TextString:SetText(Health.." ("..format("%.0f",HealthPercent).."%)")
else
_G[FrameName.."FrameHealthBar"].TextString:SetText(format("%.0f",Health).."k ("..format("%.0f",HealthPercent).."%)")
end
end
end
end
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)
should work

#7
Posted 21 December 2012 - 08:02 PM
Draakex, on 16 December 2012 - 10:09 AM, said:
just adjust the code above to:
should work
FrameList = {"Player", "Target", "Focus"}
function UpdateHealthValues(...)
for i = 1, select("#", unpack(FrameList)) do
local FrameName = (select(i, unpack(FrameList)))
if UnitHealth(FrameName) < 1000 then
local Health = UnitHealth(FrameName)
else
local Health = (UnitHealth(FrameName))/1000
local HealthPercent = (UnitHealth(FrameName)/UnitHealthMax(FrameName))*100
if UnitHealth(FrameName) < 1000 then
_G[FrameName.."FrameHealthBar"].TextString:SetText(Health.." ("..format("%.0f",HealthPercent).."%)")
else
_G[FrameName.."FrameHealthBar"].TextString:SetText(format("%.0f",Health).."k ("..format("%.0f",HealthPercent).."%)")
end
end
end
end
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)
should work
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













