• 0

    posted a message on LuaTexts Official Thread
    That would be extremely helpful. I found it hard to find stuff with 149 pages of stuff and search doesn't really work for some things the way you want it too.

    Thanks Sfan27 that finally works exactly how i want it. I modified it to be .1fk but i see how this works now this is great really. Thanks a ton!
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from sfan27
    modified Short() #### -> #.##k
    local cur,max=HP(unit),MaxHP(unit)
    if cur > 9999 then
     cur = Short(cur,true)
    end
    if max > 9999 then
     max = Short(max,true)
    end
    return "|cff33cc66%s|r || |cff33cc66%s|r", cur,max
    There are an innumerable amount of ways to do this, and I think this is the first time I have actually written the short modification in this way.


    Im really thankful for your help perhaps you missed something i have no clue as i am an amateur coder. I understand what your script is doing but it doesn't actually work in pitbull. It just shows up as if i were to use the normal Short tag.

    Currently it shows as 5469 | 5469 for the cur and max. Where as i would prefer if i could make it show as 5.4k | 5.4k. Is that even possible? Maybe i am missing something?
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from sfan27
    putting false in the Short() tag (or omiting true) will return the formating, but not the number. You would only want to do that for testing purposes.

    Short(input,true) returns a four digit number in all possible situations (not counting "." as a character")

    10 > input - #
    100 > input > 9 - ##
    1000 > input > 99 - ###
    10000 > input > 999 - ####
    100000 > input > 9999 - ##.#k
    1000000 > input > 99999 - ###k
    10000000 > input > 999999 - #.##M
    100000000 > input > 9999999 - ##.#M
    1000000000 > input > 99999999 - ###M
    etc.

    "10000 > input > 999 - ####" is the most commonly modified output, #.##k is often created and you can find numerous examples of such in this thread.


    I searched through the threads and i couldn't seem to find anything maybe i am an idiot (possibly true) or maybe im using the wrong search parameters but how would i input that into something like this:

    return "|cff33cc66%s|r || |cff33cc66%s|r", Short(HP(unit),true),Short(MaxHP(unit),true)


    yes i am a noob lol!


    @ohidosee
    I think you might be able to do that with filters no?
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from cerbul
    I think is a bit of missunderstanding here.
    As I remember, Short(hp(unit), true), does show it the following way:

    if hp= 1000 then it shows 1.0k
    if hp= 999 then it shows 999

    (so I think I remembered it wrong, and only if under 1000 hp, it will show it normal)

    I might be wrong, but that is what I remember.

    Anyone knows what does this: Short(hp(unit), false) ?


    Ive tried very short and I've tried short many times. Short shows as

    if hp = 10000 then it shows 10.0k
    if hp = 9999 then it shows 9999

    I've tested this in game with the latest version of pitbull.

    You wouldn't have to put in false after (unit) as it is default flagged as false.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Very short shows it as 1k | 5k how can you make it to show as 1.0k | 5.0k is that possible?
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Ahh thank you I understand it all now i think. From my experimenting you were right the Short function only condenses things greater 9999 so if my hp is at 15.0k then when it drops below 10.0k it will turn into 9589 or w.e. This is unfortunate and i dont know how to change it to be lower than 999. I would prefer that.

    I fully understand the colors now you will have to excuse me im a bit of a beginner when it comes to programming hehe. :confused:

    Thanks again :)
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from cerbul

    return "|cff%02x%02x%02x%s|r",r,g,b, Short(HP(unit),true)


    Yeah your code doesn't work comes up with {ERR}

    I want it to display say 5.4k | 6.4k. I don't want it to have to be over 9999 in order to shorten to 6.4k. Caiths used to work wonderfully until the patch came and i decided to upgrade to pitbull 3.

    I really dont understand the color part either where do i input what colors i want.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Here is what I have currently



    Its not exactly working the way i want it i have been trying to get it to display like something below. The bottom right is the health with current and max health and bottom left is the Power with current and max mana or w.e in there.

    this is how i would like it to look:



    Does anyone know how i can get it to look like that?
    Posted in: Unit Frames
  • To post a comment, please or register a new account.