1. 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.

    Spoiler: Show


    Here is the code that I am using:
    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)
    Edited: December 24, 2018

  2. Code:
    Outline()
    local s = Status(unit)
    if s then
    return s
    end
    local cur, max = HP(unit), MaxHP(unit)
    local r,g,b=ClassColor(unit)
    return '|cff%02x%02x%02x%s/%s || %s%%|r',r,g,b,Short(cur,true),Short(max,true),Percent(cur,max)
    You can try this, I believe it should work, haven't tested it though. Also I'm unsure what you were trying to do there between lines 9 to 20. As it seems to me that you're not actually making any use of it.

  3. Code:
    Outline()
    local s = Status(unit)
    if s then
    return s
    end
    local cur, max = HP(unit), MaxHP(unit)
    local r,g,b=ClassColor(unit)
    return '|cff%02x%02x%02x%s/%s || %s%%|r',r,g,b,Short(cur,true),Short(max,true),Percent(cur,max)
    You can try this, I believe it should work, haven't tested it though. Also I'm unsure what you were trying to do there between lines 9 to 20. As it seems to me that you're not actually making any use of it.
    I love you so much! PM me your in game name and I'll send you a primo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •