@Kilter that script for 5e damage rolls is really cool. I've been trying to adjust it to work with the official Pathfinder Second Edition sheet, but still can't get it to recognize when a damage roll is made... Anyone able to spot what I'm missing? I've got this so far extractRoll = function(msg){ return _.chain(msg.inlinerolls) .reduce(function(m,v,k){ m['$[['+k+']]']=v.results.total || 0; return m; },{}) .reduce(function(m,v,k){ return m.replace(k,v); },msg.content) .value(); } findRollResult = function(msg, rollname, isString = 0){ let pattern = new RegExp('{{' + rollname + '=(.+?)}}'); let result = 0; if (isString > 0) { msg.content.replace(pattern,(match,rollResult)=>{ result = rollResult; }); } else { msg.content.replace(pattern,(match,rollResult)=>{ result = parseInt(rollResult); }); } return result; } on("chat:message", function(orig_msg) { if (orig_msg.rolltemplate && orig_msg.inlinerolls) { if(/{{dmg\d=/.test(orig_msg.content)){ let msg = _.clone(orig_msg), damageType, damageBase, damageCrit, atk1, atk2, critTarget, charName; damageBase = damageCrit = atk1 = atk2 = 0; damageType = charName = ''; msg.content = extractRoll(msg); msg.content.replace(/charname=(.+?)$/,(match,charname)=>{ charName = charname; }); damageType = findRollResult(msg, 'roll02_info', 1); damageBase = findRollResult(msg, 'roll02') + findRollResult(msg, 'roll04'); damageCrit = damageBase * 2; if (damageType == 'Heal') { sendChat('', '!setattr --silent --name Damage Tracker --lastHeal|' + damageBase); sendChat('', '/w gm [Apply Healing](!
%{Damage Tracker|ApplyHeal}) | [Damage Undead](!
%{Damage Tracker|DamageUndead})'); } else { sendChat('', '!setattr --silent --name Damage Tracker --lastBaseDamage|' + damageBase); sendChat('', '!setattr --silent --name Damage Tracker --lastCritDamage|' + damageCrit); sendChat('', ' /w gm [Hit](!
%{Damage Tracker|ApplyDamage}) | [Critical](!
%{Damage Tracker|ApplyDamageWithCrit}) | [Other](!token-mod --ids @{target|token_id} --set bar1_value|?{Dmg Amount|0}) '); } } } }); And here's a sample macro: @{Shezukoatl|whispertype} &{template:rolls} {{limit_height=@{Shezukoatl|roll_limit_height}}} {{charactername=@{Shezukoatl|character_name}}} {{header=Scythe—Rage}} {{subheader=^{melee_strike}}} {{notes_show=@{Shezukoatl|roll_show_notes}}} {{notes=**DEADLY:** [**+1d10**](`/r 1d10) dmg on crit}} {{roll01_name=^{attack}}} {{roll01=[[1d20cs20cf1 + [ ] 4[@{Shezukoatl|text_modifier}] + (@{Shezukoatl|query_roll_bonus})[@{Shezukoatl|text_bonus}]]]}} {{roll01_type=attack}} {{roll01_info=Deadly d10 | Trip}} {{roll01_critical=1}} {{roll02_name=^{damage}}} {{roll02=[[1D10 + 4[@{Shezukoatl|text_ability_modifier}] + 0[WEAPON SPECIALIZATION] + 0[TEMP] + 0[OTHER] + @{Shezukoatl|query_roll_damage_bonus}[@{Shezukoatl|text_roll_damage_bonus}]]]}} {{roll02_type=damage}} {{roll02_info=slashing}} {{roll04_name=^{damage_additional}}} {{roll04=[[2]] electricity, [[1d3]] fire}} {{roll04_type=damage}}