1. #1
    Epic! phai's Avatar
    10+ Year Old Account
    Join Date
    Oct 2009
    Location
    Switzerland
    Posts
    1,602

    PitBull4 - Marking as Rare with LUA in Name

    Hi Guys

    I just want to insert a LUA Code in my Targets Name Text that marks it as "Rare" if it is rare.

    So something like:
    Garneg (Rare)

    How do I do this? Currently there is this code placed in:
    Code:
    return '%s %s%s%s',Name(unit),Angle(AFK(unit) or DND(unit))
    Can anyone help me? Thanks

  2. #2
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    Try this
    Code:
    local classi = UnitClassification(unit)
    if classi == 'rare' or classi == 'rareelite' then
      return '%s (rare) %s%s%s', Name(unit), Angle(AFK(unit) or DND(unit))
      else
      return '%s %s%s%s',Name(unit),Angle(AFK(unit) or DND(unit))
    end
    would be able to help more if you gave the whole luatext, instead of just the return line. :-)

  3. #3
    Deleted
    Code:
    return '%s %s%s%s%s', Name(unit), UnitClassification(unit):find('rare') and "(rare) " or "", Angle(AFK(unit) or DND(unit))
    Taryble, PB4 only uses one line, which is the return. It then calls string.format(arg1, ...).

  4. #4
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    Looking at the scripts posted in the PB4 forums, you can do more than single lines of code for PB4's LuaTexts - I had some fairly complex ones when I used the addon. That is, unless Shefki altered the LuaTexts plugin heavily since I used it. I haven't used PB4 in over a year, myself. :-)

  5. #5
    Deleted
    Of course you can, but the pre-defined PB4 lua text for name only uses the line posted by the OP, which is what I meant.

    EDIT: Was referring to this:
    Quote Originally Posted by Taryble
    would be able to help more if you gave the whole luatext, instead of just the return line. :-)

  6. #6
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    Ahhhh, okay. I haven't used PB4 in... quite a long time... so I wasn't aware of that. :-)

  7. #7
    Epic! phai's Avatar
    10+ Year Old Account
    Join Date
    Oct 2009
    Location
    Switzerland
    Posts
    1,602
    thank you guys very much I really appreciate your efforts!

    Here's a little heart for you both:

    <3

Posting Permissions

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