Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
The developers are currently investigating an issue with logging in + accessing the VTT.
Create a free account

New update broke Autobuttons

As the title says the new sheet update broke Autobuttons
1757135560
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Master Azroth! I take it you mean the D&D 5e (2034) Sheet? In what way did Autobuttons break? Are they crashing the sandbox, failing to appear, giving incorrect results or failing to modify HP properly?
Yes the new 2024 sheet. After the update they no longer appear on 2024 sheet rolls but still work on 2014 sheet rolls if you have a game with both.
1757216282
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It probably has something to do with the new "roll templates" that were just rolled out. I'm guessing that whatever triggers the script looks for have changed. I'll see if I can get the author's attention.
I'm also a longtime fan of the AutoButtons script and yes it was broken because the output structure / labels have changed with the latest update. I managed to get it to work but the fix is a bit hacky. Preferably we get a proper fix from Oosh. If you're desperate or Oosh don't have the time to fix it, you can try my hacky fix. It basically ignores the damage type parsing (which I was already not using anyway) and goes straight for just the final damage number. Snippet of where the change needs to be made. I tried uploading the full script but I think it's too long. const scanBeaconRollOutput = (sheet, msgContent) => { const beaconSheet = preset[sheet]?.beaconSheet; if (beaconSheet) { const templateName = msgContent.match(beaconSheet.templates.nameGroupRegex)?.[1] ?? ''; if (beaconSheet.templates.nameTriggerRegex.test(templateName)) { // Roll-template-patch: Skipping this as it doesn't work. Not needing the damage type anyway. //const header = msgContent.match(beaconSheet.templates.damageGroupRegex)?.[1] ?? ''; //if (beaconSheet.templates.damageTriggerRegex.test(header)) { // Instead we will check if the new damage group identifier exists. if (beaconSheet.templates.damageGroupRegex.test(msgContent)) { const damageResult = msgContent.match(beaconSheet.templates.damageResultGroupRegex)?.[1] ?? ''; return damageResult ? parseInt(damageResult) : null; } } } } // Make script do stuff checkInstall(); on('chat:message', handleInput); } /** * SHEET PRESET DATA */ // Experimental Beacon support const dndDamageTypes = ['custom', 'Acid', 'Bludgeoning', 'Cold', 'Fire', 'Force', 'Lightning', 'Necrotic', 'Piercing', 'Poison', 'Psychic', 'Radiant', 'Slashing', 'Thunder']; const beaconPreset = { dnd5e_2024: { sheet: ['dnd5e_2024'], templates: { nameGroupRegex: /^<rolltemplate\sclass="([\w-]+)/, nameTriggerRegex: /^dnd-2024/, // Roll-template-patch: Change to use the new exact damage identifier //damageGroupRegex: /class="header__subtitle">([^<]+)/, damageGroupRegex: /class="dnd-2024__result dnd-2024__result--Normal dnd-2024__result--damage/, damageTriggerRegex: new RegExp(dndDamageTypes.reduce((output, type, index) => { return`${output}${index === 0 ? `\(${type}|` : index === dndDamageTypes.length - 1 ? `${type}\)` : `${type}|`}`; }, ''), 'i'), damageResultGroupRegex: /data-result="(\d+)/, damageFields: ['damage'], critFields: ['crit'], upcastDamage: [], upcastCrit: [], }, defaultButtons: ['damage', 'damageHalf', 'healingFull'], } };
1757237874
Oosh
Sheet Author
API Scripter
Thanks for the report - at the time I wrote in the 2024 support, there wasn't anything structural to grab hold of in the template to figure out what a damage roll was, so I had to use damage type text. Good to know there's something a bit more reliable to watch for now - I'll try to get a fix out in the next couple of days.
Thank you! My players and I definitely appreciate this script. :-)