I had the same Issue using this kind of Code. Try "UnitDebuff" instead of "UnitAura".
For some odd reason UnitAura doesn't seem to work for Debuffs in this case.
I had the same Issue using this kind of Code. Try "UnitDebuff" instead of "UnitAura".
For some odd reason UnitAura doesn't seem to work for Debuffs in this case.
Thanks for the reply. I tried the UnitDebuff instead of UnitAura and it now seems to be working perfectly. Will definitely be using this text from now on and adapting it to my other characters.
Updated priest code (I left out something in the previous post, which is why it wasn't working)
if select(2, UnitClass("player")) == "PRIEST" then
local pws, r, pom = "", "", ""
if UnitAura(unit, "Power Word: Shield") or UnitAura(unit, "Weakened Soul", nil, "Harmful") then
pws = "|cffffffffS|r"
end
if UnitAura(unit, "Renew") then
r = "|cff11a918R|r"
end
if UnitAura(unit, "Prayer of Mending") then
pom = "|cffccbb66M|r"
end
return "%s%s%s", pom, r, pws
end
For any other classes you can use the class name, but it has to be all capitals for the test to work.
If you want the same code for multiple classes, you might want to try something like this:
local _, class = UnitClass("player")
if class == "PRIEST" then
-- do priest stuff here
end
if class == "MAGE" then
-- do mage stuff here
end
if class == "WARLOCK" then
-- do warlock stuff here
end
Note that the use of UnitBuff and UnitDebuff is deprecated, as they are just wrappers for UnitAura with the "Helpful" or "Harmful" keywords, but that does mean a function within a function, and as I like to optimise for speed, esp in 25-mans, I prefer UnitAura.
Also note that UnitAura has 2 forms:
one where you check each buff one by one in a loop - UnitAura("unit", index [, "Helpful" | "Harmful" ] )
and the other by name - UnitAura("unit", "name" [, "rank" [, "Helpful" | "Harmful" ] ] )
"Helpful" is the default which is why there are 2 parameters for PW:S, but 4 for "Weakened Soul" (the nil is there cause we don't want a specific rank) - you have to specify "Harmful" explicitly if you want to check a "debuff".
Hope this helps you
Here is what I use for Prayer of Mending:
local name, _, icon, count, _, _, expTime = UnitBuff(unit, "Prayer of Mending")
if name then
UpdateIn(0.5)
return "%d|T%s:0|t(%d)", count, icon, expTime - GetTime()
end
This one checks for missing buffs, and shows a big . in the colour of the missing buff. (You need to set the text % quite high to get a nice round dot )
if select(2, UnitClass("player")) == "PRIEST" then
local pos, pof, posp = "|cff105caa.|r", "|cff53ff80.|r", "|cff5c2a71.|r"
if UnitAura(unit, "Divine Spirit") or UnitAura(unit, "Prayer of Spirit") then
pos = ""
end
if UnitAura(unit, "Power Word: Fortitude") or UnitAura(unit, "Prayer of Fortitude") then
pof = ""
end
if UnitAura(unit, "Shadow Protection") or UnitAura(unit, "Prayer of Shadow Protection") then
posp = ""
end
return "%s%s%s", pos, pof, posp
end
You can also swap it around and have the . if they have the buff (instead of missing it).
if select(2, UnitClass("player")) == "PRIEST" then
local pos, pof, posp = "", "", ""
if UnitAura(unit, "Divine Spirit") or UnitAura(unit, "Prayer of Spirit") then
pos = "|cff105caa.|r"
end
if UnitAura(unit, "Power Word: Fortitude") or UnitAura(unit, "Prayer of Fortitude") then
pof = "|cff53ff80.|r"
end
if UnitAura(unit, "Shadow Protection") or UnitAura(unit, "Prayer of Shadow Protection") then
posp = "|cff5c2a71.|r"
end
return "%s%s%s", pos, pof, posp
end
Last edited by onaforeignshore : 01/13/10 at 12:24 PM.
I want to do something which I guess is very simple. I want to edit my name text so that rather than displaying Name followed by <AFK> or <DND> it displays Name or <AFK> followed by <DND>.
I'd hoped it would be as simple as switching the 'or' with a comma and vice versa. i.e.
local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s|r %s%s%s',r,g,b,string.sub(Name(unit),1,15),Angle(AFK(unit) or DND(unit))
to
local r,g,b = ClassColor(unit)
if isAFK(unit) == false
return '|cff%02x%02x%02x%s|r',r,g,b,string.sub(Name(unit),1,15)
else
return '|cff%02x%02x%02x%s%s%s|r',Angle(AFK(unit))
end
but this doesn't seem to take.
Edit: to be honest I'm not worried about the <DND>, I really just want Name or <AFK>
Edit2: updated code to my current attempt. still not working though.
Edit3: got it. in case anyone else ever wants it:
local r,g,b = ClassColor(unit)
if IsAFK(unit) then
return '%s%s%s',Angle(AFK(unit))
else
return '|cff%02x%02x%02x%s|r',r,g,b,string.sub(Name(unit),1,20)
end
Last edited by ratskinmahoney : 01/22/10 at 1:20 PM.
I haven't been able to find this in the search, or anywhere on the web. I used to have a DogTag that would place the name of my Target's Target below my Target's bars. I haven't figured out how to do that with LuaText. I know how to place it under the bars, but I can't find or figure out a code for just the Target's Target name. Can anyone help out? Thanks.
EDIT: I found a solution that Shefki posted on another site.
local target_name = UnitName(unit.."target")
if target_name then
return target_name
end
It works somewhat. The only problem I'm having is it doesn't seem to update when the target switches their target. I'm not sure what events I should use. He mentioned UNIT_TARGET but it's not on my list in Pitbull v4.0.0-beta 8. Any ideas?
So I understood that LUA texts are way more powerful than Dogtags. Since every add-on for World of Warcraft is written in LUA i have a little question concerning LUA texts and LUA itself.
At the moment I use Pitbull4 with LUA texts to display a '+' if anyone in my party/raid has got no blessings by me. In party it's naturally no problem because you don't often have more than 2 paladins.
In raids however there are situations, where i just don't have to put a blessing on everyone. So i would be shown a '+' on the respective frame even if i don't have to put any blessing on that unit. So my question is if LUA texts are so powerful that it would be possible to counter-check with Pallypower if I have to put a blessing on the unit and then check if I have done it.
Maybe somebody here, who knows a bit more about the functioning of LUA can enlighten me. Thanks.
local happiness = GetPetHappiness()
local happy
if happiness == 1 then
happy = "C41F3B"
elseif happiness == 2 then
happy = "FFF569"
elseif happiness == 3 then
happy = "ABD473"
else
happy = "FFFFFF"
end
return '|cff%s%s|r',happy,Name(unit)
For others who use Stuf unit frames; I thought I'd share a Lua text that shows pet happiness colored names for those as the one above doesn't work for it. Apparently Stuf uses a different way of formatting the code than other unit frames like Pitbull.
function(unit, cache, textframe)
local petlove, petlovecolor, petname
local petlove, _, _ = GetPetHappiness()
local petname = UnitName("pet")
if (petlove == 3) then petlovecolor = "|c0000ff1f"
elseif (petlove == 2) then petlovecolor = "|c00ffee1f"
elseif (petlove == 1) then petlovecolor = "|c00ff0000"
else petlovecolor = "|c00FFFFFF" end
return petlovecolor..petname.."|r" end
Another one, help would be appreciated. Somehow it is not working out. Should show s colored timer if its my shield and unicolored timer if it isnt mine.
Outline()
local _, _, _, _, _, _, expires, caster, _ = UnitAura(unit,"Sacred Shield")
if caster == "player" then
local rem = - (GetTime() - expires)
UpdateIn(0.25)
if rem > 45 then
return "|cff00ff00%d|r", rem
elseif rem >30 then
return "|cffffff00%d|r", rem
elseif rem > 15 then
return "|cffffa500%d|r",rem
elseif rem > 0 then
return "|cffff0000%d|r",rem
end
elseif caster ~= "player" then
local rem = - (GetTime() - expires)
UpdateIn(0.25)
if rem > 0 then
return "|cffffff00%d|r", rem
end
end
local i = 1
local ttw,dam,hit,crit,wisdom= false,false,false,false,false
local tr,tg,tb = FF,00,00
local dr,dg,db = FF,00,00
local hr,hg,hb = FF,00,00
local cr,cg,cb = FF,00,00
local wr,wg,wb = FF,00,00
while true do
local name,_,icon = UnitAura(unit,i,"HARMFUL")
if not name then
break
elseif name == "Thunder Clap" then
ttw = true
elseif name == "Infected Wounds" then
ttw = true
elseif name == "Icy Touch" then
ttw = true
elseif name == "Earth and Moon" then
dam = true
elseif name == "Ebon Plague" then
dam = true
elseif name == "Curse of Elements" then
dam = true
elseif name == "Misery" then
hit = true
elseif name == "Faerie Fire" then
hit = true
elseif name == "Totem of Wrath" then
crit = true
elseif name == "Heart of the Crusader" then
crit = true
elseif name == "Judgment of Wisdom" then
wisdom = true
end
i = i + 1
end
if ttw then
tr,tg,tb = 00,FF,00
elseif dam then
dr,dg,db = 00,FF,00
elseif hit then
hr,hg,hb = 00,FF,00
elseif crit then
cr,cg,cb = 00,FF,00
elseif wisdom then
wr,wg,wb = 00,FF,00
end
return “|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r" ,tr,tg,tb,"T |n",dr,dg,db,"D |n",hr,hg,hb,"H |n",cr,cg,cb,"C |n",wr,wg,wb,"W |n" or ‘’
I just started playing again and I've been using a personalized variation of this. Now mages can supply the 3% damage (Arcane Empowerment - Spell - World of Warcraft), but as a buff to the player (same name as the talent), instead of a debuff to the target. I've been trying to code this in, but with no luck. Can anyone help me out?
Based on previously posted code, I hacked together a quick tag to use with ShadowedUF to track my druid's hots in a single line of color coded text (including lifebloom stacks):
The output looks something like this:
*{5}{15}{20}{5}(3)
The only problem I'm having is that I still can't figure out a way to check and see if Swiftmend is available. I'm currently checking for either Regrowth or Rejuv, and whether SM is usable, but the tag still considers it usable even while it's on cooldown. I've also checked to be sure that the SM indicator doesn't show up while the spell isn't in my spec.
Does anyone know of a way to detect the duration of a cooldown remaining on a spell for the purposes of a LuaText tag? If so, please do share, as this could lead to useful tags such showing when it becomes possible to cast a specific debuff again a boss, whether an interrupt is available against a casting target, and so on.
function(unit, unitOwner)
local rejuv, regrow, wild, lb = "","","",""
local SMready = false
if UnitAura(unit, "Rejuvenation") then
SMready = true
local _,_,_,_,_,_,timeleft,caster = UnitAura(unit, "Rejuvenation")
if caster == "player" then
local rem = - (GetTime() - timeleft)
rem = string.format("%d",rem)
rejuv = "|cffFF6699[" .. rem .. "]|r"
end
end
if UnitAura(unit, "Regrowth") then
SMready = true
local _,_,_,_,_,_,timeleft,caster = UnitAura(unit, "Regrowth")
if caster == "player" then
local rem = - (GetTime() - timeleft)
rem = string.format("%d",rem)
regrow = "|cff99ff33[" .. rem .. "]|r"
end
end
if UnitAura(unit, "Wild Growth") then
local _,_,_,_,_,_,timeleft,caster = UnitAura(unit, "Wild Growth")
if caster == "player" then
local rem = - (GetTime() - timeleft)
rem = string.format("%d",rem)
wild = "|cffffff00[" .. rem .. "]|r"
end
end
if UnitAura(unit, "Lifebloom") then
local _,_,_,stacks,_,_,timeleft,caster = UnitAura(unit, "Lifebloom")
if caster == "player" then
local rem = - (GetTime() - timeleft)
rem = string.format("%d",rem)
lb = "|cff66ffff[" .. rem .. "](" .. stacks ..")|r"
end
end
if SMready and IsUsableSpell("Swiftmend") then
sm = "*"
else
sm = ""
end
return sm .. wild .. rejuv .. regrow .. lb
end
Last edited by Noraj : 02/15/10 at 7:55 AM.
Reason: Clarification
"The question is not how far we are going to take it... the question is, do you possess the constitution to go as far as needed?" - Il Duce
In raids however there are situations, where i just don't have to put a blessing on everyone. So i would be shown a '+' on the respective frame even if i don't have to put any blessing on that unit. So my question is if LUA texts are so powerful that it would be possible to counter-check with Pallypower if I have to put a blessing on the unit and then check if I have done it.
You could tap into the PallyPower code and check who you need to buff, then feed that result to LuaText. You would have to look through the PallyPower code and understand what to look for though, or see if there is a library that handles the assignment.
Made a code to track if people are in range of my Paladin's auras. This is the first i've gotten to successfully work with a "caster == player" tag in it. I'm not sure if it actually tracks only my auras, but it didn't give me an error or not show up at all.
I'm sure there is a more compact way to do this, but I don't know how. I just found a text someone posted for their Lifebloom tracker and edited that.
local _, _, _, nCA, _, _, _, caster, _= UnitAura(unit,"Crusader Aura")
if nCA and caster == "player" then
Outline()
return "|cffFFFF00.|r", nCA
end
local _, _, _, nDA, _, _, _, caster, _= UnitAura(unit,"Devotion Aura")
if nDA and caster == "player" then
Outline()
return "|cff0000FF.|r", nDA
end
local _, _, _, nRA, _, _, _, caster, _= UnitAura(unit,"Retribution Aura")
if nRA and caster == "player" then
Outline()
return "|cffFF0000.|r", nRA
end
local _, _, _, nCoA, _, _, _, caster, _= UnitAura(unit,"Concentration Aura")
if nCoA and caster == "player" then
Outline()
return "|cffFFFFFF.|r", nCoA
end
Ok I play an Affl lock and use Pitbull 4 and had a quick question on how to do a custom hp lua for the target/mobs/boss hp bar.
I want the hp bar to change to a diffrent color only when 25% or below so I know when to change to the drain soul rotation. I have it currenty showing hp and percent on the hp bar now but I'd rather do away with it and just have the color change, would be easier to notice. And I don't see the need to install another addon to remind me when I'm sure I can modify an existing one.
[edit] ok looking at it more i see i can't change the bars it seems without editing the addon itself maybe. So if someome could help me get the name or HP text maybe to change color if >25%
Looking for a way to show my current damage percentage modifier as a lua-text within pitbull. I got this courtesy of Crowfeather on the wowinterface lua forums. I have no knowledge of lua though and how I would apply this to lua-scripts.
I was wondering if anyone could help me translate this coding into LUA. It currently checks myself if I am not dead and in a party. The coloring's not that important, I can figure that out on my own.
Any help is much appreciated, thank you.
[(if ~Dead and InGroup then
" " (if HasAura("Power Word: Fortitude") or HasAura("Prayer of Fortitude") then
" ":Color("F5F5F5")
else
"F":Color("F5F5F5")
end) (if HasAura("Greater Blessing of Kings") or HasAura("Blessing of Kings") or HasAura("Drums of Forgotten Kings")then
" ":Color("FF8591")
else
" K ":Color("FF8591")
end) (if HasAura("Gift of the Wild") or HasAura("Mark of the Wild") then
" ":Color("DE7000")
else
"G":Color("DE7000")
end) (if HasAura("Blessing of Might") or HasAura("Greater Blessing of Might") or HasAura("Battle Shout") then
" ":Color("996633")
else
" M ":Color("996633")
end) (if HasAura("Windfury Totem") or HasAura("Improved Icy Talons") then
" ":Blue
else
"WF":Blue
end) (if HasAura("Abominable Might") or HasAura("Trueshot Aura") or HasAura("Unleashed Rage") then
" ":Cyan
else
" UR ":Cyan
end) (if HasAura("Strength of Earth") or HasAura("Horn of Winter") then
" ":Red
else
"SoE":Red
end) (if HasAura("Leader of the Pack") or HasAura("Rampage") then
" ":Color("DE7000")
else
" LotP":Color("DE7000")
end)
end)]
I'm really sorry if this is a stupid request, but I really suck at writing LUA and I'm going crazy here.
I'm trying to convert this DogTags-text into LUA and for the life of me, I can't. Please halp!
[Classification] [Level:DifficultyColor] [(if IsPlayer then
Class
else
SmartRace
end):ClassColor]
To clarify, what I want is as follows:
1. Classification(if Boss or Elite or rare or whatever, then that's shown. If none of those, then show nothing)
2. The level of the unit, with appropriate difficulty coloring
3. If the unit is a player controlled unit then I want the class to be shown (i.e. Rogue, Mage) in the appropriate color, however if the unit is an NPC I want the creaturetype to be shown (i.e. Beast, Undead, Humanoid)
Basically the way ag_UF displays the info. Now, the Class: Standard lua that's already in PB4 almost does what I want, but it lists the class and creaturetype.
I'm really sorry for being so anal, but if anyone could convert this for me you'd have my undying gratitude.
I'd really like to translate the last of my DogTags to LuaTexts for PB4. Atm, I'm using both DogTags and LuaTexts at the same time and this just seems silly and inefficient. Only trouble is some of my DogTags are a little complex. Trying to piece together different bits of LuaTexts hasn't worked out well for me, so any help translating these is appreciated:
Player Power
Color-coded percentage (without percentile symbol) for power, on mouseover displays short true MP/power.
(found a code for this but doesn't include the custom colors, I'd basically use this for HP too):
[(if IsMouseOver = "True" then
MP:Short
else
(if PercentMP > 70 then
PercentMP:VeryShort:Color("C0FF3E")
elseif PercentMP > 35 < 70 then
PercentMP:VeryShort:Color("ffcc00")
elseif PercentMP < 35 then
PercentMP:Hide(0):VeryShort:Color("ff8000")
end) " " [if not IsMana then
DruidMP:Short:Color("00bfff")
end]
end)]
Player Resting/PVP/Leader/MasterLooter (found part of this, but nothing for master looter):
[(if IsLeader then
"L" Color("FFFFFF")
end) (if IsMasterLooter then
"+":Color("C0FF3E")
end) " " (if IsResting then
"R":Color("CCCCCC")
end) " " (if PvP then
"P":Red
end)]
Party Debuffs
[(if HasAura("Unstable Affliction") then
"X":Red
end) (if HasCurseDebuff then
" C":Fuchsia
end) (if HasMagicDebuff then
" M":Color("00bfff")
end) (if HasPoisonDebuff then
" P":Color("66cc00")
end) (if HasDiseaseDebuff then
" D":Yellow
end)]
Party Name
If unit does not have a curse, disease, magic, or poison debuff and has threat, name is colored red, otherwise name is default with a + if is leader, a green + if master looter, and a red + if flagged for PVP. Plus AFK and DND, though I'd like to remove the AFK timer if possible.
[if not HasCurseDebuff & not HasDiseaseDebuff & not HasMagicDebuff & not HasPoisonDebuff & not HasAura("Unstable Affliction") then
[if (ThreatStatus = "1") or (ThreatStatus = "2") or (ThreatStatus = "3") then
Name:Red
else
Name (if IsMasterLooter then
"+":Color("C0FF3E")
elseif IsLeader then
"+"
end) " " [(if PvP then
"+":Red
end)] " " (AFK or DND)
end]
end]
Target Name
If flagged for PVP displays a red + next to the name, if elite displays a default ( or white) + next to the name, if unit is casting, displays spell name.
[(if PvP then
"+":Red
end) (if (Classification(unit="target") = "Elite") then
"+"
else
nil
end) (if CastName then
CastName
else
Name
end)]
Thanks in advance for any assistance, even via PMs. I'm using these tags for FujiUI, in case anyone is curious to see the DogTags themselves in action.
Last edited by treelet : 04/18/10 at 3:42 PM.
Reason: Clarification
I've done a lot of work trying to get this to come out right. It appears as tho this section of code is working. As shown, I am a rogue so I focused it on buffs that apply to me.
if select (2, UnitClass("player")) == "ROGUE" then
local f, g, k, m, wf, ur, soe, lotp, hst, dmg, crit = "|TInterface/Icons/spell_holy_prayeroffortitude:30|t", "|TInterface/Icons/spell_nature_giftofthewild:30|t", "|TInterface/Icons/spell_magic_greaterblessingofkings:30|t", "|TInterface/Icons/ability_warrior_battleshout:30|t", "|TInterface/Icons/spell_deathknight_icytalons:30|t", "|TInterface/Icons/ability_warrior_intensifyrage:30|t", "|TInterface/Icons/spell_nature_earthbindtotem:30|t", "|TInterface/Icons/spell_nature_unyeildingstamina:30|t", "|TInterface/icons/ability_paladin_swiftretribution:30|t", "|TInterface/Icons/spell_nature_starfall:30|t","|TInterface/Icons/spell_shaman_elementaloath:30|t"
UpdateIn(0.25)
if UnitAura(unit, "Fortitude") or UnitAura(unit, "Power Word: Fortitude") or UnitAura(unit, "Prayer of Fortitude") then
f = ""
end
if UnitAura(unit, "Mark of the Wild") or UnitAura(unit, "Gift of the Wild") then
g = ""
end
if UnitAura(unit, "Blessing of Kings") or UnitAura(unit, "Greater Blessing of Kings") or UnitAura(unit, "Blessing of Forgotten Kings") then
k = ""
end
if UnitAura(unit, "Battle Shout") or UnitAura(unit, "Blessing of Might") or UnitAura(unit, "Greater Blessing of Might") then
m = ""
end
if UnitAura(unit, "Improved Icy Talons") or UnitAura(unit, "Windfury Totem") then
wf = ""
end
if UnitAura(unit, "Abomination's Might") or UnitAura(unit, "Unleashed Rage") or UnitAura(unit, "Trueshot Aura") then
ur = ""
end
if UnitAura(unit, "Strength of Earth") or UnitAura(unit, "Horn of Winter") then
soe = ""
end
if UnitAura(unit, "Rampage") or UnitAura(unit, "Leader of the Pack") then
lotp = ""
end
if UnitAura(unit, "Moonkin Aura") or UnitAura(unit, "Retribution Aura") or UnitAura(unit, "Concentration Aura") or UnitAura(unit, "Devotion Aura") then
hst = ""
end
if UnitAura(unit, "Arcane Empowerment") or UnitAura(unit, "Ferocious Inspiration") or UnitAura(unit, "Retribution Aura") or UnitAura(unit, "Concentration Aura") or UnitAura(unit, "Devotion Aura") then
dmg = ""
end
if UnitAura(unit,"Elemental Oath") or UnitAura(unit, "Moonkin Aura") then
crit = ""
end
return "%s%s%s%s%s%s%s%s%s%s%s", f, g, k, m, wf, ur, soe, lotp, hst, dmg, crit
end
I dont know if this code is by any means optimized. It does work, I don't know a whole lot about coding, just enough to mimic it and get a desired product. This script will display several icons, run a loop every 0.25 seconds and check for buffs (some buffs like sanctified retribution and swift retribution had to be fudged). If it finds any of these buffs, it will remove the icon.
TL: DR, if you see an icon you're missing that equivalent buff.
I am going to start working on a debuff checker and will post it when I am finished.
Again, if you know of any ways to better ways to handle this code please feel free to post it.
As promised here are the Debuff checks I made, split into two scripts.
local sar, sag, sab = 255, 0, 0
local ffr, ffg, ffb = 255, 0, 0
local dmgr, dmgg, dmgb = 255, 0, 0
local bleedr,bleedg,bleedb = 255,0,0
local critr,critg,critb = 255,0,0
UpdateIn(0.25)
if UnitDebuff("target", "Sunder Armor") or UnitDebuff("target", "Expose Armor") then
sar, sag, sab = 0, 255, 255
end
if UnitDebuff("target", "Faerie Fire") or UnitDebuff("target", "Faerie Fire Feral") then
ffr, ffg, ffb = 0, 255, 255
end
if UnitDebuff("target", "Blood Frenzy") or UnitDebuff("target", "Blood Poisoning") then
dmgr, dmgg, dmgb = 0, 255, 255
end
if UnitDebuff("target", "Mangle (Cat)") or UnitDebuff("target", "Mangle (Bear)") or UnitDebuff("target","Trauma") then
bleedr,bleedg,bleedb = 0,255,255
end
if UnitDebuff("target","Heart of the Crusader") or UnitDebuff("target","Deadly Poison") or UnitDebuff("target","Totem of Wrath") then
critr,critg,critb = 0,255,255
end
return "|cff%02x%02x%02x20%%|r |cff%02x%02x%02x5%%|r |cff%02x%02x%02xDmg|r |cff%02x%02x%02xBleed|r |cff%02x%02x%02xCrit|r" , sar, sag, sab, ffr, ffg, ffb, dmgr, dmgg, dmgb, bleedr,bleedg,bleedb, critr,critg,critb
AND
local mdr, mdg, mdb = 255, 0, 0
local hr, hg, hb = 255, 0, 0
local scr,scg,scb = 255, 0, 0
UpdateIn(0.25)
if UnitDebuff("target", "Curse of the Elements") or UnitDebuff("target", "Earth and Moon") or UnitDebuff("target","Ebon Plague") then
mdr, mdg, mdb = 0, 255, 255
end
if UnitDebuff("target", "Faerie Fire") or UnitDebuff("target", "Misery") then
hr, hg, hb = 0, 255, 255
end
if UnitDebuff("target", "Shadow Mastery") or UnitDebuff("target", "Improved Scorch") or UnitDebuff("target","Winter's Chill") then
scr, scg, scb = 0, 255, 255
end
return "|cff%02x%02x%02x13%%|r |cff%02x%02x%02xHit|r |cff%02x%02x%02xS.Crit|r",mdr, mdg,mdb,hr,hg,hb,scr,scg,scb
Again, if you see any better way to accomplish the same thing in a more efficient manner, by all means.