
I have the following sheet worker: const NPCp = [ 'NPC1physical', 'NPC2physical', 'NPC3physical', 'NPC4physical', 'NPC5physical', 'NPC6physical', 'NPC7physical', 'NPC8physical', 'NPC9physical', 'NPC10physical', 'NPC11physical', 'NPC12physical' ]; NPCp.forEach(button => { on(`clicked:${button}`, () => { getAttrs(['[`${button}used`]', 'ones', 'twos', 'threes', 'fours', 'fives', 'sixes', 'sevens', 'eights', 'nines', 'tens'], v => { startRoll(`&{template:NPC} {{name=@{actor}}} {{action=Physical}} {{Roll=[[[[@{${button}}]]d10]]}}`, (NPCp) => { const dice = NPCp.results.Roll.dice //This will be an array of the values rolled on all the dice const setObj = {[`${button}used`]: 1}; setObj.dummy1 = dice.filter(d => d === 1).length; setObj.dummy2 = dice.filter(d => d === 2).length; setObj.dummy3 = dice.filter(d => d === 3).length; setObj.dummy4 = dice.filter(d => d === 4).length; setObj.dummy5 = dice.filter(d => d === 5).length; setObj.dummy6 = dice.filter(d => d === 6).length; setObj.dummy7 = dice.filter(d => d === 7).length; setObj.dummy8 = dice.filter(d => d === 8).length; setObj.dummy9 = dice.filter(d => d === 9).length; setObj.dummy10 = dice.filter(d => d === 10).length; finishRoll( NPCp.rollId, // this is where you save the computed values into something that can be passed to rolltemplates. { } ); setAttrs(setObj); }); }); }); }); When one of those 12 buttons is clicked (NPC1physical, NPC2physical, etc.) it performs a roll of xd10, where x is the stat value for the NPC in question. Then it sets the values of ten attributes: dummy1 is set to the number of 1s rolled, dummy 2 is set to the number of 2s rolled, etc. This much is working perfectly. What I'm now trying to figure out is how to sum the attribute @ones with the new value of @dummy1 in such a way that the total can be reported in the rolltemplate. Same for twos + dummy2, etc. In other words, how do I tell the rolltemplate the value of @ones added to the number of 1s rolled?