You would just need to install the Scriptcards api script (available for 1-click install) and run the macro as written from a collections macro or character ability. Scriptcards parses the macro line by line. The body of the macro is very short: --#title|3d10 exploding mechanic
--#nominmaxhighlight|1
--=Total|0
-->RollDice|
--+Total|[$Total]
--X| End macro The macro also has two functions "RollDice" and "BubbleUp", that are called multiple times. The rolls and all the logic are handled by the scriptcards parser. For example, this line (found in the RollDice function) --=Roll1|1d10 ...assigns a d10 roll result to a roll variable named "Roll1". We do this three times, populating Roll1, Roll2, and Roll3. Then the results are sorted using a bubble sort algorithm. Then the value of the middle die is added to the total (which starts at 0) with this line: --=Total|[$Total] + [$Roll2] This part (also after sorting) checks if the middle die was a 10 and if so recursively calls the RollDice function and we repeat the above process. --?[$Roll2] -eq 10|[
-->RollDice|
--]| When this is all done, we finally print out the total with this line --+Total|[$Total]