Hi all,
After patch and updating my Pitbull 4 a few pieces of code I use seem to be broken. I got this code from some lovely people here when I came asking for help before. The code is:
Health/Player:
local cur, max = HP(unit), MaxHP(unit)
local PerHP = cur/max
local hr, hg, hb
if (PerHP < 0.5) then
hr = 255
hg = 255 * PerHP * 2
hb = 0
else
hr = 255 * (1 - ((PerHP - 0.5) * 2))
hg = 255
hb = 0
end
and
Health/Target:
local cur, max = HP(unit), MaxHP(unit)
local PerHP = cur/max
local hr, hg, hb
if (PerHP < 0.5) then
hr = 255
hg = 255 * PerHP * 2
hb = 0
else
hr = 255 * (1 - ((PerHP - 0.5) * 2))
hg = 255
hb = 0
end
return "|cff%02x%02x%02x%s - %s%%|r", hr, hg, hb, Short(cur,true), Percent(cur, max)
They don't show as errors on Pitbull but when I use them I keep getting Blizzard Lua error screens popping up and the errors just keeping increasing until I reload the ui. It then starts all over again. I have just disabled them completely.
I have lots of little bits of code for Pitbull (all written by other people! I am clueless
but only these 2 seem to be having problems.
I would be most grateful if anybody could take a look and maybe fix them for me =)