Jump to content

  • Curse Sites
Help

Health Numbers + Percentage?


  • Please log in to reply
8 replies to this topic

#1 blackcherryx3

blackcherryx3
  • Members
  • Posts: 2

Posted 04 December 2012 - 06:32 PM

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 *_*

#2 Pyonx

Pyonx
  • Premium Junkies
  • Night Elfclass_name
  • EU-Outland
  • Misery
  • Posts: 359
  • Talents:
  • RBG: 2318

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 blackcherryx3

blackcherryx3
  • Members
  • Posts: 2

Posted 04 December 2012 - 07:20 PM

Will it take long to LUA something like that?

#4 Pyonx

Pyonx
  • Premium Junkies
  • Night Elfclass_name
  • EU-Outland
  • Misery
  • Posts: 359
  • Talents:
  • RBG: 2318

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.

#5 systm32

systm32
  • Members
  • Posts: 1

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 Draakex

Draakex
  • Junkies
  • Undeadclass_name
  • EU-Blackrock
  • Glutsturm / Emberstorm
  • Posts: 265
  • Talents: Holy 1/2/1/0/1/0
  • RBG: 1149
  • LocationGermany

Posted 16 December 2012 - 10:09 AM

just adjust the code above to:

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

Posted Image


#7 AvantOnline

AvantOnline
  • Premium
  • Curse Premium
  • Posts: 8

Posted 21 December 2012 - 08:02 PM

View PostDraakex, on 16 December 2012 - 10:09 AM, said:

just adjust the code above to:

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
dont working for pet and powerbar

#8 Draakex

Draakex
  • Junkies
  • Undeadclass_name
  • EU-Blackrock
  • Glutsturm / Emberstorm
  • Posts: 265
  • Talents: Holy 1/2/1/0/1/0
  • RBG: 1149
  • LocationGermany

Posted 22 December 2012 - 01:49 PM

View PostAvantOnline, on 21 December 2012 - 08:02 PM, said:


dont working for pet and powerbar
wasn't asked, but you could add "Pet" to the FrameList in the first line for also adding this functionality to pets

Posted Image


#9 AvantOnline

AvantOnline
  • Premium
  • Curse Premium
  • Posts: 8

Posted 22 December 2012 - 03:50 PM

View PostDraakex, on 22 December 2012 - 01:49 PM, said:

wasn't asked, but you could add "Pet" to the FrameList in the first line for also adding this functionality to pets
what about powerbar\manabar




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<