Jump to content

  • Curse Sites
Help

LF HP % on Nameplates script / addon

script percent nameplate execute

  • Please log in to reply
7 replies to this topic

#1 BalanceRexxar

BalanceRexxar
  • Junkies
  • Orcclass_name
  • US-Rexxar
  • Vengeance
  • Posts: 219
  • Talents: Windwalker 1/0/2/2/0/0
  • 2v2: 2542
  • 3v3: 2864
  • 5v5: 2288
  • RBG: 2180

Posted 09 June 2013 - 12:38 AM

I play WW monk and touch of death is only 10% so the majority of the time I only have one chance to use it before they either die from something else or go to 11% or higher, what I'm looking for is very simple.

I'm looking for a script / addon that keeps default blizzard nameplates and has a health % above on or below the nameplate itself.

If anyone has a script to do so or knows of an addon that shows % but deosn't change the look or castbar of the default nameplates I'd be very grateful.

Thanks yo.

#2 Frion

Frion
  • Junkies
  • Undeadclass_name
  • EU-Burning Legion
  • Cataclysme / Cataclysm
  • Posts: 15
  • Talents: Frost 0/0/0/2/1/2
  • 2v2: 1834
  • 3v3: 2070
  • 5v5: 1983
  • RBG: 2192

Posted 10 June 2013 - 04:13 PM

Sorry for no author of this but i just dont know (have alot scripts saved in txt file)
local fixvalue = function(val)
	if(val >= 1e6) then
		return ('%.2f'..SECOND_NUMBER_CAP):format(val / 1e6):gsub('%.?0+(['..FIRST_NUMBER_CAP..SECOND_NUMBER_CAP..'])$', '%1')
	elseif(val >= 1e4) then
		return ('%.1f'..FIRST_NUMBER_CAP):format(val / 1e3):gsub('%.?0+(['..FIRST_NUMBER_CAP..SECOND_NUMBER_CAP..'])$', '%1')
	else
		return val
	end
end
CreateFrame('frame'):SetScript('OnUpdate', function(self, elapsed)
	 for index = 1, select('#', WorldFrame:GetChildren()) do
		  local f = select(index, WorldFrame:GetChildren())
		  if f:GetName() and f:GetName():find('NamePlate%d') then
			   f.h = select(1, select(1, f:GetChildren()):GetChildren())
			   if f.h then
					if not f.h.v then
						 f.h.v = f.h:CreateFontString(nil, "ARTWORK")   
						 f.h.v:SetPoint("CENTER", f.h, 'CENTER')
						 f.h.v:SetFont(STANDARD_TEXT_FONT, 9, 'OUTLINE')
					else
						 local _, maxh = f.h:GetMinMaxValues()
						 local val = f.h:GetValue()
						 f.h.v:SetText(string.format("%s - %d%%", fixvalue(val), math.floor((val/maxh)*100)))
					end
			   end
		  end
	 end
end)

Posted Image

#3 BalanceRexxar

BalanceRexxar
  • Junkies
  • Orcclass_name
  • US-Rexxar
  • Vengeance
  • Posts: 219
  • Talents: Windwalker 1/0/2/2/0/0
  • 2v2: 2542
  • 3v3: 2864
  • 5v5: 2288
  • RBG: 2180

Posted 11 June 2013 - 05:10 AM

thanks man

#4 Vernaz

Vernaz
  • Members
  • Taurenclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 10
  • Talents: Restoration 1/0/2/1/0/0
  • RBG: 2028
  • LocationAustralia

Posted 20 June 2013 - 06:21 AM

If you don't want to use a script I suggest Healthbartext addon

#5 Thazable

Thazable
  • Premium Junkies
  • Curse Premium
  • Humanclass_name
  • EU-Frostmourne
  • Blutdurst
  • Posts: 163
  • Talents: Protection 1/0/1/1/2/1
  • 2v2: 2256
  • 3v3: 2672
  • 5v5: 1627

Posted 17 July 2013 - 02:26 PM

That's actually pretty neat, but is there a way to only display the actual % on the plates w/o the hp value?
Posted Image

#6 Wildbreath

Wildbreath
  • Premium
  • Curse Premium
  • Night Elfclass_name
  • EU-Азурегос
  • Шквал
  • Posts: 26
  • Talents: Feral 0/0/2/1/2/1

Posted 30 July 2013 - 06:20 AM

i'm author

#7 Syncrow

Syncrow
  • Premium
  • Curse Premium
  • Posts: 180

Posted 01 August 2013 - 07:15 PM

View PostThazable, on 17 July 2013 - 02:26 PM, said:

That's actually pretty neat, but is there a way to only display the actual % on the plates w/o the hp value?

CreateFrame('frame'):SetScript('OnUpdate', function(self, elapsed)
  for index = 1, select('#', WorldFrame:GetChildren()) do
	local f = select(index, WorldFrame:GetChildren())
	if f:GetName() and f:GetName():find('NamePlate%d') then
	  f.h = select(1, select(1, f:GetChildren()):GetChildren())
	  if f.h then
	 if not f.h.v then
	   f.h.v = f.h:CreateFontString(nil, "ARTWORK")  
	   f.h.v:SetPoint("RIGHT")
	   f.h.v:SetFont(STANDARD_TEXT_FONT, 9, 'OUTLINE')
	 else
	   local _, maxh = f.h:GetMinMaxValues()
	   local val = f.h:GetValue()
	   f.h.v:SetText(string.format(math.floor((val/maxh)*100)).." %")
	 end
	  end
	end
  end
end)


#8 Thazable

Thazable
  • Premium Junkies
  • Curse Premium
  • Humanclass_name
  • EU-Frostmourne
  • Blutdurst
  • Posts: 163
  • Talents: Protection 1/0/1/1/2/1
  • 2v2: 2256
  • 3v3: 2672
  • 5v5: 1627

Posted 06 August 2013 - 11:03 AM

View PostSyncrow, on 01 August 2013 - 07:15 PM, said:

CreateFrame('frame'):SetScript('OnUpdate', function(self, elapsed)
for index = 1, select('#', WorldFrame:GetChildren()) do
local f = select(index, WorldFrame:GetChildren())
if f:GetName() and f:GetName():find('NamePlate%d') then
	 f.h = select(1, select(1, f:GetChildren()):GetChildren())
	 if f.h then
	 if not f.h.v then
	 f.h.v = f.h:CreateFontString(nil, "ARTWORK")
	 f.h.v:SetPoint("RIGHT")
	 f.h.v:SetFont(STANDARD_TEXT_FONT, 9, 'OUTLINE')
	 else
	 local _, maxh = f.h:GetMinMaxValues()
	 local val = f.h:GetValue()
	 f.h.v:SetText(string.format(math.floor((val/maxh)*100)).." %")
	 end
	 end
end
end
end)
Wow, big thanks buddy. :)
Posted Image





Also tagged with one or more of these keywords: script, percent, nameplate, execute

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<