Alright so, I have a PC with 9 natural attacks (it's a crazy game), and want to make a 1 button macro for all of them. After digging around, and getting assistance from a friend, I've got: <a href="https://pastebin.com/cfnVCUwQ" rel="nofollow">https://pastebin.com/cfnVCUwQ</a> Which is ugly. So I'll show you also how it's generated: const attackOrder = [0,0,1,2,3,4,4,5,5] const characterName = "Read Gale" const head = `@{PC-whisper} &{template:pf_attack} @{toggle_attack_accessible} @{toggle_rounded_flag} {{font=@{apply_specfont_chat}@{use_specfont}}} {{scroll_desc=@{scroll-desc}}} {{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}}` const iterNum = num => num>0?num+1:'' const wepID = n => `${characterName}|repeating_weapon_$${n}_` let attack = (id, num) => `{{attack${iterNum(num)}= [[ 1d20cs>[[ @{${wepID(id)}crit-target} ]] + @{${wepID(id)}total-attack} ]] }}` let damage = (id, num) => `{{damage${iterNum(num)}=[[@{${wepID(id)}damage-dice-num}d@{${wepID(id)}damage-die}+@{${wepID(id)}total-damage}]]}}` let critConfirm = (id, num) => `{{crit_confirm${iterNum(num)}=[[ 1d20 + @{${wepID(id)}total-attack}+[[@{${wepID(id)}crit_conf_mod}]]]]}}` let critDamage = (id, num) => `{{crit_damage${iterNum(num)}=[[[[@{${wepID(id)}damage-dice-num}*(@{${wepID(id)}crit-multiplier}-1)]]d@{${wepID(id)}damage-die}+((@{${wepID(id)}damage_macro})*[[@{${wepID(id)}crit-multiplier}-1]])]]}}` attackName = (id, num) => `{{attack${num+1}name=@{${wepID(id)}name}}}` require('fs').writeFileSync('output.txt', head+(attackOrder.map(function(id, num) { return attack(id,num)+damage(id,num)+critConfirm(id,num)+critDamage(id,num)+attackName(id,num) }).join(' ')) ) That is some javascript (runnable with Node.js) that I used to create the macro. It works perfectly, except the last 2-5 rolls decide to not work properly randomly. A picture is worth a thousand words: These two pictures (one of them may post twice, it was being weird) were taken from the same macro/template, completely unmodified. I'm hoping someone can point out what I need to fix to make it work right. Also, any suggestions for the macro builder script (beyond what's needed to fix the original macro) would be great. I ran into a lot of weirdness trying to incorporate precision damage and bonus critical damage. Is there some "flag" I need to set to make the pseudo-iteratives I've created work properly?