Hi, thanks for your reply...
The code is this:
Lua Code:
local prgname = "|cffffd200autopsy|r"
local function color(destName)
if not UnitExists(destName) then return string_format("|cffff0000%s|r", destName) end
local _, class = UnitClass(destName)
local color = _G["RAID_CLASS_COLORS"][class]
return string_format("|cff%02x%02x%02x%s|r", color.r*255, color.g*255, color.b*255, destName)
end
-- begins code on parsing CLEU
local timeStamp, event, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, prefixParam1, prefixParam2, _, suffixParam1, suffixParam2 = ...
-- proceed with CLEU handling
if not playerGUID then
playerGUID = UnitGUID("player")
end
if destGUID == playerGUID or (destName and UnitClass(destName)) then
-- prevent the case the sourceName is nil (sometimes it is happened)
sourceName = sourceName or "Someone"
if event == "SWING_DAMAGE" then
if prefixParam2 > 0 then
print(string_format("%s: [%s] killed [%s] with %s Melee overkill %s", prgname, sourceName, color(destName), prefixParam1, prefixParam2))
autopsy_msg = string_format("autopsy: [%s] killed [%s] with %s Melee overkill %s", sourceName, destName, prefixParam1, prefixParam2)
SendChatMessage(autopsy_msg, autopsy_chn)
end
-- proceed with other code and damage types...
The print() works fine and I think I can use as a self output.
The SendChatMessage is not able to to color both the "prgname" nor the color(destName) ...
The only problem of this approach is that I have to deal with 2 different string format for the output if I'd like to mantain the colors in the "self" output.
Btw if can't be solved it is not a problem, so ... :-)
Thanks very much for your kind reply.