Slayer uses "%1%5%2%3%7: %4" for chat involving team colors, and I get the feeling %5 is a color code. I want to use that alone, but I have no idea how to get just %5.
I'd use word counts and extract it from %fmsg in clientCmdChatMessage, but some servers like to add words to clan tags, and this messes extraction up.
I'd rather not succumb to for loops that check for the presence of a name, in case (for some reason) someone has their name as a clan tag, or their clan tags were modified to contain it somewhere.
EDIT: Looked in Slayer's code, found commandToAll('chatMessage', %client, '', '', %all, %pre, %name, %suf, %msg, %color, %team.name, "<color:ffffff>");
I thought I might be able to just add %color onto the end of the function definition, but %color is just blank?
function clientCmdChatMessage(%a, %b, %c, %fmsg, %clanPrefix, %name, %clanSuffix, %msg, %color) {
// %color is for slayer
%soundMode = $Pref::Client::CustomChat::SoundNotificationMode;
%taggedString = stripMLControlChars(getTaggedString(getWord(%fmsg, 0)));
switch$(%taggedString) {
case "%1%2%3: %4" or "%1%2%3%7: %4" or "%1%5%2%3%7: %4" or "%5%1%2%5%3%7: %4" or "[%5%6] %1%2%3%7: %4":
%isChatMsg = 1;
}
if(!%isChatMsg) {
// isn't a chat message
return parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %clanPrefix, %name, %clanSuffix, %msg);
}
if(%taggedString $= "%1%5%2%3%7: %4") {
echo(%color); // %color is just blank, even though Slayer must be sending /something/?
%forcedColor = %color;
%forceAllowColor = 1;
}