Quantcast
WoWInterface - View Single Post - Combine two lua scripts
View Single Post
06-21-20, 02:35 PM   #6
Kanegasi
A Firelord
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 495
According to PitBull documentation, "LuaText" is simply fed into SetFormattedText and Angle returns three strings, which surrounds the input with "angle brackets" < >. If there's no input, in this case if the unit is not afk or dnd, it still returns three empty strings. Also, if you want to use the pipe character or the percent sign, you need to escape both.

Lua Code:
  1. local s=Status(unit)
  2. if s then return s end
  3. local cur,max=HP(unit),MaxHP(unit)
  4. local hr,hg,hb=HPColor(cur,max)
  5. return "|cff%02x%02x%02x%s|r %s%s%s || |cff%02x%02x%02x%.0f|r %%",ClassColor(unit),Name(unit),Angle(AFK(unit) or DND(unit)),hr,hg,hb,100*cur/max

I left a space between the health and the percent sign.

Edit: I didn't refresh the page before posting, looks like you got it working anyways

Last edited by Kanegasi : 06-21-20 at 02:40 PM.
  Reply With Quote