I like to have buffs show up as short coloured text next to my group and raid frames. I've got this working lovely on my priest, with Fort and Spi showing if people don't have those buffs, and Sh, R, M and Shielded showing up if people do have the relevant buffs.
However as I like to have a universal appearance between characters, and I like to tweak my layout every other week or so, I was trying to condense the two into one luatext which checks player class then uses the appropriate bit, so that I didn't have to use a seperate layout on each character.
Try as I might I just get errors about not ending functions properly or I get no error, but no text either. Would anyone be good enough to help me with this or point me in the right direction please?
Edit: Spent some more time trying things out and got an error I could work with and managed to get what I wanted working. In case anyone else wants something similar here's what I'm using:
local englishClass = UnitClass("player") local i = 1 local fort,spirit,shadow,renew,mend,shield = true,true,false,false,false,false local wild,thorns,rejuv,regrow= true,false,false,false while true do local name = UnitAura(unit,i,HELPFUL) if not name then break elseif name == "Prayer of Fortitude" or name == "Power Word: Fortitude" then fort = false elseif name == "Prayer of Spirit" or name == "Divine Spirit" then spirit = false elseif name == "Prayer of Shadow Protection" or name == "Shadow Protection" then shadow = true elseif name == "Renew" then renew = true elseif name == "Prayer of Mending" then mend = true elseif name == "Power Word: Shield" then shield = true elseif name == "Mark of the Wild" or name == "Gift of the Wild" then wild = false elseif name == "Thorns" then thorns = true elseif name == "Rejuvenation" then rejuv = true elseif name =="Regrowth" then regrow = true end i = i + 1 end if englishClass == "Priest" then return "|cff00BFFF%s|r |cff99FFFF%s|r |cffCC33FF%s|r |cff3FFF3F%s|r |cffE6CE77%s|r %s",fort and "Fort" or '',spirit and "Spi" or '',shadow and "Sh" or '',renew and "R" or '',mend and "M" or '',shield and "Shielded" or '' elseif englishClass == "Druid" then return "|cffBA55D3%s|r |cffCD6839%s|r |cff9900cc%s|r |cff33FF33%s|r",wild and "Wild" or '',thorns and "Th" or '',rejuv and "R" or '',regrow and "Re" or '' end