// SawbonesThen create a trigger called limbprepped (you can name it whatever you like as long as you change the argument in the client.reflex_enable function):
var limbName;
var limbStatus;
client.reflex_enable(client.reflex_find_by_name("trigger", "limbprepped", true, true));
^(Right leg|Left leg|Right arm|Left arm|Torso|Head): \s+ (Perfect health|Barely damaged|Lightly damaged|Moderately damaged|Heavily damaged|Crippled)$In this trigger, copy and paste the following:
limbName = args[1];You can change the colors to whatever you like. I haven't added lines for epseth/epteth/shatter/smash breaks.
limbStatus = args[2];
if (args[2].match(/Perfect health/)) {
client.current_line.parsed_line.colorize(0, 30, 'black', 'white');
}
if (args[2].match(/Barely damaged/)) {
client.current_line.parsed_line.colorize(0, 30, 'black', 'green');
}
if (args[2].match(/Lightly damaged/)) {
client.current_line.parsed_line.colorize(0, 30, 'black', 'yellow');
}
if (args[2].match(/Moderately damaged/)) {
client.current_line.parsed_line.colorize(0, 33, 'black', 'orange');
}
if (args[2].match(/Heavily damaged/)) {
client.current_line.parsed_line.colorize(0, 30, 'black', 'red');
}
if (args[2].match(/Crippled/)) {
client.current_line.parsed_line.colorize(0, 30, 'white', 'black');
}
Comments
It also looks like you're not actually using the limbName thing. If that's the case, no point in saving it - change the first capture group to "(?:Right leg|...)" and you can just use args[1].
I have tested the trigger and it works for all instances, so \s+ has caused no problems, at least none that I could produce.
"...): \s+ (Perfect health|..."
instead of
"...):\s+(Perfect health|..."
is strange.
There are no tabs in the message, so all you actually need is " +".