Hello! I am working with a friend to make an automatic crit/fumble function that works when clicking on attributes/stats in the character sheet. I've got everything working as I'd like, except for when it comes to adding attribute/skill values to the roll. I've got the exploding dice working and they are sent to chat. My issue arises when I want to refer to a button attribute and use it when rolling. I'm not sure it can be done as I'd like, but I thought I'd ask. What I am trying to do is to call upon a custom attribute in my button. My button is currently: <button type='action' name="act_roller" data-i18n="awarenes-u" class='sheet-skill-roller''>AWARENESS</button> When I call on startRoll later, it looks thus: startRoll("&{template:roller} {{name=Roller}} {{roll=[[1d10+@{int}[STAT]+@{awareness_total}[SKILL]+?{ADDITIONAL MODS? (Bright Light, No Vision, Terrain etc)|0}[MOD]]]}} {{explode1=[[1d10]]}} {{explode2=[[1d10]]}} {{explode3=[[1d10]]}} {{explode4=[[1d10]]}} {{explode5=[[1d10]]}} {{explode6=[[1d10]]}} {{explode7=[[1d10]]}} {{explode8=[[1d10]]}} {{explode9=[[1d10]]}} {{explode10=[[1d10]]}}", (results) => {
Ignore all the exploding dice. All that matters is the initial roll called "roll". As you can see, I'm asking it to add @{int} and @{awareness_total} as well as a custom modifier in the end. But I want to remove @{int} and @{awareness_total} to replace them with a placeholder. What I'd like to do is something like: <button type='action' name="act_roller" attributeName="@{int}" skillName="@{awareness_total}" data-i18n="awarenes-u" class='sheet-skill-roller''>AWARENESS</button> in order to use a placeholder in the roll that then takes the attributes from the button: startRoll("&{template:roller} {{name=Roller}} {{roll=[[1d10+attributeName[STAT]+skillName[SKILL]+?{ADDITIONAL MODS? (Bright Light, No Vision, Terrain etc)|0}[MOD]]]}} {{explode1=[[1d10]]}} {{explode2=[[1d10]]}} {{explode3=[[1d10]]}} {{explode4=[[1d10]]}} {{explode5=[[1d10]]}} {{explode6=[[1d10]]}} {{explode7=[[1d10]]}} {{explode8=[[1d10]]}} {{explode9=[[1d10]]}} {{explode10=[[1d10]]}}", (results) => {
By doing so, I'd avoid having to make the startRoll function for every skill and be able to simply call on it based on the information from the button. Can I do something like this? Any help would be appreciated.