Repository navigation
feat(Customizable-Roll-Listener): Rewrite for Beacon sheets - #2363
Open
steverobertsuk wants to merge 13 commits into
Open
steverobertsuk wants to merge 13 commits into
steverobertsuk wants to merge 13 commits into
Conversation
Version 2 is built from ES modules under src/ in the same way as Hexploration and TokenController: Rollup bundles them into CRL.js and the 2.0.0/ snapshot, Prettier formats the output, and the scripts handle version bumps and locale synchronisation. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…n chat Version 1.1 only matched some chat output. Its "not parseable" errors were swallowed crashes on rolls with modifiers or text without "##"; its text was used as a raw regular expression; "##" only found the first ten inline rolls; dropped dice counted as crits; and Beacon sheets such as D&D 2024, which post HTML roll cards with their dice in msg.rolls, were never matched at all. The rewrite analyses every message (roll templates, plain chat, /roll results, rollable tables and Beacon advancedroll cards) and matches listeners on templates, message types, plain or regex text, speakers, players, crit/fumble/success/fail, totals and natural dice. Commands support placeholders, can be sent as CRL or the roller, and have cooldowns, ordering, stop-after and loop protection. An inspector explains what a message contains and why each listener did or did not fire. Commands stay as abilities on the existing store character, and rules are mirrored into each ability's description so listeners survive a game copy. Version 1 state, listeners and \create-style commands are upgraded automatically. Chat text encodes Roll20 syntax, because sendChat drops a whole message it cannot resolve. Menus, a Help handout and a Command Deck are translatable; locales other than en-US fall back to English until they are generated. Credits Scott C. as the original author and The Aaron for the 1.1 fixes. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…nd-to-end tests The suites cover message analysis and matching (crits, fumbles, dropped dice, targets, text, tables, filters), command and version 1 parsing, placeholders and translation keys, and D&D 2024 checks, attacks, damage and advantage built from cards captured in a live Jumpgate game. The end-to-end suite drives the built bundle in a stubbed Roll20 sandbox, including the version 1 upgrade, game copies and loop protection. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Adds a README for GMs, a changelog of what version 2 fixes and adds, a developer guide to the data model and matching, a file map, and a testing guide with the manual checklist and the results from the live D&D 2024 test game. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Adds the bundled CRL.js for the One-Click library and its identical 2.0.0/ snapshot. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…ames A user reading the README could not find which roll template names to use with --templates. The README and the Help handout now explain what a template name is and how to find one (the inspector, a sheet's macro or the sheet's source), list the templates of the built-in default, D&D 5E by Roll20 (2014) and D&D 2024 sheets, and link to Roll20's roll template articles. The templates prompt and option description point to them. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Each version heading now shows its release date, taken from the repository history, in the same style as the other mods' changelogs. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…s a table The supported languages were one long comma-separated paragraph, which was hard to scan. They are now a table with the code to use in !crl config language, the language's English name and its native name. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…nguages table Each language row now starts with its flag, taken from the locale metadata, so a language is quicker to spot. The flag's name is shown on hover. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…images Roll20 does not draw flag emoji in handouts (Windows shows them as letters), so the flags were missing. Each flag is now its Twemoji SVG image, as ConditionTracker does, with the flag's name as alt text and title. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Roll20 whispers only the first line of a message and posts every later line publicly. A listener card whose commands span several lines, and the inspector's extra message data (pretty-printed JSON), therefore leaked to the players; found while testing a real version 1 game with MetaScriptToolbox installed. Code blocks now use <br> for line breaks, and every card is kept on one line before it is sent. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Tested in a Legacy game holding 47 real version 1 listeners: the upgrade kept every listener's templates, text, roll checks and commands, and the D&D 5E 2014 sheet checks passed. The sheet's NPC attacks use the npcfullatk template, which Roll20's help article does not list, so it is added to the template tables. The README and Help handout now explain that the sheet rolls advantage and disadvantage as two separate d20s, both of which CRL checks. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Every locale now holds all 280 strings. Nine files had only their
handout translated, or none of it, and the rest were machine
translations with literal errors ("die" as dying, "roll" as bread
rolls, "speaker" as a loudspeaker) and with commands, options and
typed values translated, so pasted examples would not work. Each file
was translated or reviewed in full, with !crl commands, --options,
placeholders and values such as crit and on kept in English, and the
missing languages-table headings and 2014 sheet advantage note added.
The README, changelog and developer notes describe the translations.
Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[2.0.0] – 2026-10-29
A full rewrite by MidNiteShadow7 of Scott C.'s Customizable Roll Listener, which was reported as working on some chat output but not all, especially since Beacon sheets arrived, and is no longer supported.
Fixed
roll=criticaland so on) no longer fail with "CRL ERROR ||| Ability: … was not parseable". Version 1 crashed on any roll containing a modifier, a group or a comment, and on text without##, then skipped the listener and logged the error on every chat message.##finds inline rolls at any position. Version 1 only found the first ten ($[[0]]to$[[9]]), so long roll templates were missed, and only converted the first##in each piece of text.(,+,?,.and similar characters silently matched something else.kh/kl) and rerolled dice no longer count as crits or fumbles./rollresults (rollresultandgmrollresultmessages) are read.advancedrollroll cards with no inline rolls or template name, so CRL reads the template, character, title and each roll from the card.!crlcommand are kept in the listener's commands instead of being rolled once and lost.@{…},%{…},[[…]]and?{…}encoded, because Roll20 drops a mod's whole message when it cannot resolve them.\\configdeletes a listener.Added
!crl <command> --option valuesyntax. Listeners can be named by name or ID.>=15,<=2,19-20), and a choice of which dice to check.${who},${character},${player},${template},${total},${natural},${result},${expression},${table},${listener}and${field:name}.!crl inspect: explains the next chat message (type, template and fields, every roll with its dice, the text listeners search) and why each listener did or did not trigger. Useful for Beacon sheets such as D&D 2024.!crl test: runs a listener's commands with sample values.CRL.analyse,CRL.matches,CRL.onMatch.Changed
failmeans a target roll with no successes.\\create,\\edit,\\delete,\\configand\\setcommands still work.src/, bundled with Rollup and tested with the Node test runner.Signed-off-by: Steve Roberts steve@shadowcomputers.co.uk