
Update v0.2.4 -- Rollable Table Item Avatar Images can be shown in the results using the ShowIcons option:

The label is the text of the Rollable Table Item name. The label can be turned off with the IconLabel option:

If your Rollable Table Items contain references to Rollable Tables which contain images, they will be displayed in the label, so turning the label off will prevent showing those recursive results.
Additionally, you can now use %% to separate options from their arguments:
Finally, PrefaceUniqueWhitespace now does a better job. Originally, it just stuffed extra spaces in front of everything, but this caused some Roll Templates to break as ' spellkey' is not the same as 'spellkey' and would fail to match properly. Now unique keys are individually tracked and prefaced with spaces so that only the ones that actually are duplicated are prefaced. (Thanks Diana P !)
Update v0.2.0 -- Completely rewritten recursion engine taking advantage of Promises and lots of error handling. Automated fixing of API sendChat() inline rolls (in most cases). New formatting options. Thanks Scott C. for the ground work on the RollTemplate fix!
RecursiveTable provides a way to expand the results of Rollable Tables which have inline rolls within them. Now with options and support for whispering Roll Templates. When using Rolltemplates, your message must have at least one
Performs all inline rolls, then continues to expand inline rolls (to a default maximum depth of around 10).
Options are separated with the verticle pipe symbol (
!rt[showicons] [[2t[Dice-Of-Fate] ]]

The label is the text of the Rollable Table Item name. The label can be turned off with the IconLabel option:
!rt[showicons|iconlabel:off] [[2t[Dice-Of-Fate] ]]

If your Rollable Table Items contain references to Rollable Tables which contain images, they will be displayed in the label, so turning the label off will prevent showing those recursive results.
Additionally, you can now use %% to separate options from their arguments:
!rt[showicons%%on|iconlabel%%off] [[2t[Dice-Of-Fate] ]]This is particularly helpful for API Command Buttons, as they would otherwise see the : and treat the command like a URL.
Finally, PrefaceUniqueWhitespace now does a better job. Originally, it just stuffed extra spaces in front of everything, but this caused some Roll Templates to break as ' spellkey' is not the same as 'spellkey' and would fail to match properly. Now unique keys are individually tracked and prefaced with spaces so that only the ones that actually are duplicated are prefaced. (Thanks Diana P !)
Update v0.2.0 -- Completely rewritten recursion engine taking advantage of Promises and lots of error handling. Automated fixing of API sendChat() inline rolls (in most cases). New formatting options. Thanks Scott C. for the ground work on the RollTemplate fix!
RecursiveTable provides a way to expand the results of Rollable Tables which have inline rolls within them. Now with options and support for whispering Roll Templates. When using Rolltemplates, your message must have at least one
{{
that in not coming from a Rollable Table. When using the PrefaceUniqueSpace
option, be sure your {{name=something}}
is first.Commands
!rt[options] [--help| ... ]
Performs all inline rolls, then continues to expand inline rolls (to a default maximum depth of around 10).
--help
-- Shows the Help screen....
-- Anything following !rt will be expanded, then sent to to the chat.
Options
These are inline settings to adjust how the rolls are put together. Options are specified in[
]
right after the !rt
:!rt[delimiter:-|maxdepth:20] something
Options are separated with the verticle pipe symbol (
|
) and have an optional argument separated by a :
. Omitting the argument causes true
to be used for switch options, or the default value. All Options are case insenstive. Options are one of 3 types: Number (any integer), Boolean (true values: on
, yes
, y
, true
. false values: off
, no
, n
, false
), or text (any value except ]
, use \|
for |
)MaxDepth
-- Specifies the number of recursions to perform. Default: 10 (Number)Delimiter
-- A string of text to put between table items. The special valueBR
will cause html line breaks to be used. Default: , (String)DropEmpty
-- Causes empty table items to be dropped before joining with the delimiter. Default: on (Boolean)Sort
-- Causes table items to be sorted before being joined by the delimiter. Note that this happens at a single layer of recursion, so if you have table items made of of lists of table items, the sorting will only be at each level. Default: off (Boolean)PrefaceUniqueSpace
-- Causes the final message to have a unique number of spaces inserted after each{{
. This is useful if you're building Roll Templates and might have multiple lines with the same label. Default: off (Boolean)ShowIcons
-- Causes table items with avatars to display their image. Default: off (Boolean)IconLabel
-- Determines if the table items with avatars have their name as a label. Default: on Boolean)
Examples
Basic usage, whispering treasure to the gm:!rt /w gm [[1t[treasure-table]]]
Whispering a roll template:
!rt /w gm &{template:default}{{treasure=[[1t[treasure-table]]]}}
Whispering a roll template, with each item on a separate line:
!rt[Delimiter:BR] /w gm &{template:default}{{treasure=[[1t[treasure-table]]]}}
Whispering a roll template, with each item on a separate line, with empty results replaced by Nothing:
!rt[Delimiter:BR|EmptyDefault:Nothing] /w gm &{template:default}{{treasure=[[1t[treasure-table]]]}}
Whispering a roll template, with each item on a separate line, with a table that is returning {{label=values}}
:
!rt[Delimiter:BR|PrefaceUniqueSpace] &{template:default}{{name=Treasure Bundles}}[[5t[treasure-bundle]]]

Prior Thread: https://app.roll20.net/forum/post/4954818/script-update-recursivetables-now-with-direct-support-for-whispering-roll-templates-and-more
Git: https://github.com/shdwjk/Roll20API/blob/master/Re...
If you use my scripts, want to contribute, and have the spare bucks to do so, go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free!
Disclaimer: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.