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 .
×
Create a free account

Help with Treasure Deck Macro

Hey There! I've purchased some rollable table treasure decks for my DnD game and I was hoping to get a hand making a macro to roll them. I'd like it to first off - 1. Query the CR of the creature     a) 1-4     b) 5-8     c) 9-12     d) 13-16     e) 17-20 2. then, ask how many times to roll 3. Give the result based on the roll (so like a /roll 4t [TreasureDeck-CR1-4]) I'm brand new at macro building, so hopefully someone can give me a hand haha
!?{CR?|1-4|5-8|9-12|13-16|17-20} !?{How many times?|1} /roll ?{How many times?}t[TreasureDeck-CR?{CR?}] or !?{CR?|1-4|5-8|9-12|13-16|17-20} !?{How many times?|1} [[?{How many times?}t[TreasureDeck-CR?{CR?}]]] However, due to a quirk with how rollable tables work, when you roll on a rollable table multiple times, it'll only show a single result.  If you want to see several results, you'll want to use the RecursiveTables script (requires the API, a Pro Subscriber feature).
1638553419
timmaugh
Forum Champion
API Scripter
Another API-dependent solution would be the Meta Toolbox, if you wanted to go that route. I managed to get the below output using the following solution... This requires a mule (an ability) on a character set up like this: TreasureRow={{Treasure=get\.MuleBoy.TreasureDeck.TreasureRowContent/get}} TreasureRowContent=[\\][\\]1t[TreasureDeck-CRget.MuleBoy.TreasureDeck.TreasureDeckTable/get] \\]\\] {\&if get.MuleBoy.TreasureDeck.RowCount/get > 1}%NEWLINE%get\\.MuleBoy.TreasureDeck.TreasureRowContent/get set\.MuleBoy.TreasureDeck.RowCount = {\& math get.MuleBoy.TreasureDeck.RowCount/get - 1}/set{\&end} RowCount=1 TreasureDeckTable=1-4 (the last two will change with every run of the macro) I named that mule "TreasureDeck" and put it on a character called "MuleBoy" to which anyone who runs the below macro will need access. To run it, use the following macro: !&{template:default}{{name=Treasure Horde!}}get\.MuleBoy.TreasureDeck.TreasureRow/get set.MuleBoy.TreasureDeck.RowCount=?{How many times?|1}/set set.MuleBoy.TreasureDeck.TreasureDeckTable=?{CR?|1-4|5-8|9-12|13-16|17-20}/set {&mule MuleBoy.TreasureDeck}{&simple} I obviously had to mock up tables, but here is some example output (2 runs, the first time asking for 4 rolls against table 1-4, then asking for 5 rolls against table 5-8): My table entries had inline rolls, themselves, and you can see that they expanded/rolled to give immediate results. REQUIRED SCRIPTS: ZeroFrame, APILogic, Muler... probably SelectManager