LF Help with Pitbull Script
Ok so I have a very specific request here and it will require someone with knowledge of LUA scripts. I will reward whoever can help me with a free primo!
Here is the situation: I am using a custom script to color code health in pitbull but with two classes I get incorrect formatting when displaying health in detailed form. This just happens for shamans and druids. Druids have paladin class color for some reason and both druid and paladin have the first digit cut off the current HP/max HP. Here's a pic of the problem.
Here is the code that I am using:
Quote:
Outline()
local s = Status(unit)
if s then
return s
end
local cur, max = HP(unit), MaxHP(unit)
local r,g,b=ClassColor(unit)
local function dec_hex(num)
local function getkey(n)
return n==10 and "a" or n==11 and "b" or n==12 and "c" or n==13 and "d" or n==14 and "e" or n==15 and "f" or tostring(n)
end
local out=""
local plcs = math.ceil(math.log(num+1)/math.log(16))
for p=plcs,1,-1 do
local a=math.floor(num/math.pow(16, p-1))
num=num-(a*math.pow(16,p-1))
out=out..getkey(a)
end
return out
end
r,g,b=dec_hex(r),dec_hex(g),dec_hex(b)
return "|cff"..r..g..b.."%s/%s || %s%%|r",Short(cur,true),Short(max,true),Percent(cu r,max)