• 0

    posted a message on PitBull 4.0
    hrmm, okay so I wrote a function that could be used to make any string vertical:
    local function vert.string(input)
    	local working = #input
    	local output = input
    	while true do
    	 if working==0 then
    	  break
    	 else
    	  local b=strsub(output,1, working-1)
    	  local e=strsub(output, working)
    	  output=strjoin("|n",b,e)
    	 end
    	 working=working-1
    	end
    	output = strsub(output,3)
    	return output
    end

    I'm not sure I wrote the function aspect of this correctly, but I do know that the core of the code works.

    I tested a very slightly modified version I made the input Name(unit)

    I tried changing the break check to working==1, and removing output = strsub(output,3). It created an infinite loop though...I'll try and solve that one.

    DO NOT RUN THIS CODE
    local function vert.string(input)
    	local working = #input
    	local output = input
    	while true do
    	 if working==1 then
    	  break
    	 else
    	  local b=strsub(output,1, working-1)
    	  local e=strsub(output, working)
    	  output=strjoin("|n",b,e)
    	 end
    	 working=working-1
    	end
    	return output
    end
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Quote from Shefki


    You can do it by putting \n or |n 's in your text string. But it's kinda a pain in the butt.
    I bet it wouldn't be too awful to write a helper function for that one.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from uhman
    UnitBuff(unit,index) is equivalent to UnitAura(unit,index,"HELPFUL") right?
    I have no idea, I'd guess so, although you had used UnitAura() without "HELPFUL at first, and that was the correction I was trying to make.

    Quote from Shefki
    Need to local i:
    local i = 1
    man I forgot to local again, I am terrible at that :(

    Quote from Shefki
    Putting a constant into a variable doesn't really matter. Either way the value exists.
    Good to know. Although in this case I feel it makes the code cleaner (definitely not having the variable named "pom" is good for generalization purposes that uhman mentioned.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    uhman: Your code looks pretty good. I assume this is being attached to your player frame. I made three changes. (a) I got rid of the "pom" variable, as it is just an unnecessary saved variable. (b) I added "HELPFUL" to your UnitAura() call. (c) I changed your debuff loop from a for 1:40 to a while true (with the break occurring the first time a nil is found). This change is for two reasons, reducing the number of loops when there aren't 40 buffs. It also adds the ability to check past the 40th buff (since that is now possible).
    if UnitInRaid(unit) then
        local raid=GetNumRaidMembers()
        for r=1,raid do 
            local un = "raid"..r
               local i=1
            while true do 
                local name,_,_,count,_,_,expTime,unCstr,_= UnitAura(un,i,"HELPFUL")
                if not name then
                    break
                if name=="Prayer of Mending"and unCstr==unit and count and expTime then
                    local r,g,b = ClassColor(un)
                    return "|cff%02x%02x%02x%s|r: %d - %d",r,g,b,UnitName(un),count,expTime-GetTime()
                end
                1=i+1
            end 
        end
    end


    If track other people's PoM was something you were truly interested in you could change this significantly, depending on the way your ui is set up. If you use pitbull for your raidframes I'd suggest just moving the tag to the raid member's frame and then checking for PoM on them, and who the caster is (rather then knowing the caster and looking for the person who it is on).
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    ahhh, I thought you had said somewhere that LuaText handled return nil for us. Regarding local, yeah I know, I just forget way too often.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    I'm not sure why Classification () wasn't working there, not within my scope of knowledge.

    This should bypass that helper function:
    local classif = UnitClassification(unit)
    if classif ~= 'normal' then
     return classif
    end
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    The tag I wrote regarding classes does display it as you wanted, for players, it just leaves out NPCs displaying 'race' alone.

    As for other issues, I'll get to it tomorrow, I'm tired from a long day of work (and by work I mean slacking off and helping you guys) and evening class.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    leemiller09: I made some slight assumptions and adjustments (class for NPCs is a meaningless piece of data), but this should work well for you:

    Health Bar, Left
    if UnitIsPlayer(unit) then
     local r,g,b = ClassColor(unit)
     return "|cff%02x%02x%02x%s|r" ,r,g,b,Name(unit)
    else
     local r,g,b = HostileColor(unit)
     return "|cff%02x%02x%02x%s|r" ,r,g,b,Name(unit)
    end


    Health Bar, Right
    local cur,max = HP(unit),MaxHP(unit)
    return "%s || %s%%",cur,Percent(cur,max)


    Power Bar, Left
    return Classification(unit)


    Power Bar, Right
    local cur,max = Power(unit),MaxPower(unit)
    return "%s || %s%%",cur,Percent(cur,max)


    Blank Space, Right
    local lvl = Level(unit)
    local dr,dg,db = DifficultyColor(unit)
    local race = SmartRace(unit)
    local class = Class(unit)
    local cr,cg,cb = ClassColor(unit)
    local form = DruidForm(unit)
    if UnitIsPlayer(unit) then
     if form then
       return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s (%s)|r "
                    ,dr,dg,db,lvl,255,204,0,SmartRace(unit),cr,cg,cb,class,form or ''
     else
       return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r"
                    ,dr,dg,db,lvl,255,204,0,SmartRace(unit),cr,cg,cb,class or ''
     end
    else
        return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r "
                    ,dr,dg,db,lvl,255,204,0,SmartRace(unit) or ''
    end
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Hrmm, you are right, it is the font. Well damn, I like Adventure.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Is there something I am doing wrong for getting alt characters to display?
    http://img189.imageshack.us/img189/8048/wowscrnshot062109194405.jpg
    As you can see in the tooltip the character has "?*" as the second character in their name.

    PS: Sabaren, use the [code] tag so your code is formatted better
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from Shefki
    sfan27, did you really put the directions for switching back to DogTags in your signature? Wow
    I want to word it to suggest against it, but seeing the same question regularly is annoying.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    TheRey: I'll create some LuaText for you (although I am going to have to guess details of those tags), but keep in mind, DogTag didn't go away, it just isn't default

    edit: okay after further inspecting of the image. I can't really figure out what you want your tags to look like, generally. Maybe describing what goes in each area would be nice.

    This is the only tag I was able to come up with:
    CurrrentHP | PercentHP%
    local cur,max = HP(unit),MaxHP(unit)
    return "%s || %s%%",cur,Percent(cur,max)
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Quote from Shefki
    It can. I was unaware that this event even existed. I'd always watched the keypress up and down events for that stuff. If so then yes just add MODIFIED_STATE_CHANGED to the events under Modules, LuaTexts. Make sure the update checkboxes have All checked.
    So I just remembered that I hadn't gotten to this. The event is actually MODIFIER_STATE_CHANGED, and it works fantastically when added.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    local cur, bubble = XP(unit), MaxXP(unit) / 20
    return "%s bubbles", floor(cur/bubble+.5)


    P.S.: There is nothing stopping you from using DogTags if you really want.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Quote from Incoming
    Is there a way to chose between LUA and DogTags that I am not aware of?
    Open Pitbull Config -> Modules -> DogTag-3.0 texts -> enable
    Open Pitbull Config -> Modules -> Lua Texts-> disable
    Posted in: Unit Frames
  • To post a comment, please or register a new account.