Here's a script to do this for you. Call it with !sumstatrolls -- in place of &{template:default} So your command would be !sumstatrolls --{{name= Character Generation 4d6k3}} {{Strength= [[4d6k3]]}} {{Dexterity= [[4d6k3]]}} {{Constitution= [[4d6k3]]}} {{Intelligence= [[4d6k3]]}} {{Wisdom= [[4d6k3]]}} {{Charisma= [[4d6k3]]}} Here's the script /* Roll a bunch of stats and total them. Use this syntax: !sumstatrolls --{{name= Character Generation 4d6k3}} {{Strength= [[4d6k3]]}} {{Dexterity= [[4d6k3]]}} {{Constitution= [[4d6k3]]}} {{Intelligence= [[4d6k3]]}} {{Wisdom= [[4d6k3]]}} {{Charisma= [[4d6k3]]}} */ on("ready", () => { const template = '&{template:default}',
sumheader = 'Total Points', processInlinerolls = function (msg) { if (_.has(msg, 'inlinerolls')) { return _.chain(msg.inlinerolls) .reduce(function(previous, current, index) { previous['$[[' + index + ']]'] = current.results.total || 0; return previous; },{}) .reduce(function(previous, current, index) { return previous.replace(index, current); }, msg.content) .value(); } else { return msg.content; } }, totalInlinerolls = function(msg) { let total = 0; if (_.has(msg, 'inlinerolls')) { total = msg.inlinerolls.reduce((total,current) => total + current.results.total ||0,0); }; return total; }; on("chat:message", msg_orig => { if(msg_orig.type == "api" && (msgMatch = msg_orig.content.match('!sumstatrolls --'))){ const msg = processInlinerolls(msg_orig); const sum = totalInlinerolls(msg_orig); let output = msg.split('--')[1].trim(); output = `${template} ${output} {{${sumheader}=${sum}}}`; sendChat("", output); } }); });