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

Prevent repeats in rollable tables.

1635283278

Edited 1635283591
I've been using the rollable tables to emulate Random Booster packs for with abilities and attribute commands, and I was wondering if there was any way for it to prevent duplicates from opening in the same set. example:  I'm using the following command to roll on the Commons table 12 times &{template:default} {{Booster [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]] [[1t[BT1-Commons]]]}} and its doing the job of rolling on the commons table, however due to having only 45 items, Its pulling up duplicates, causing my results to look like this- from the total of the 12 rolls, there are multiple duplicates. I'd like to have that be prevented if it's possible  eventually, the bottom 5 commands will be replaced so its rolling on other tables, but the same will be required of them so it's not producing duplicate results as what's already rolled.  Any help would be appreciated. Thank you! 
I don't know of anything that will remove duplicate results from rollable tables, but I can suggest (since you have a Pro subscription) that you should use the RecursiveTables  script to streamline your output. Removing duplicates is something The Aaron might be able to add as a function. The full command you would need to use is: !rt[Delimiter:BR] &{template:default} {{Booster  [[12t[BT1-Commons]]]}}
1635288019

Edited 1635335752
David M.
Pro
API Scripter
Here is an example  Scriptcard that rolls a variable number of times on a rollable table called "EyeRays" and only prints unique values to chat. Note if you choose more rolls than you have table entries you will produce an infinite loop which will crash the sandbox. Might want to add a limit. To edit, just change the title text and the name of your rollable table. The line: --=Roll|[T#EyeRays] becomes: --=Roll|[T#BT1-Commons] Here's the scriptcard macro: !scriptcard {{ --#title|Beholder Rays --:INITIALIZE ROLL VARIABLES| --=NumRolls|?{NumRolls?|3} --=RollCount|0 --&ValidResults| --:MAIN LOOP, INCR COUNTER, ROLL ON TABLE VIA "ROLLTABLE" FUNCTION, AND PRINT OUTPUT| --:Loop| --=RollCount|[$RollCount] + 1 -->RollTable| --+[$RollCount]|[$Roll.tableEntryText] --?[$RollCount] -lt [$NumRolls]|Loop --X| End macro --:FUNCTIONS| --:KEEP ROLLING UNTIL YOU GET A VALUE YOU HAVEN'T ROLLED YET| --:RollTable| --:RollLoop| --=Roll|[T#EyeRays] --?"[&ValidResults]" -inc "[$Roll.tableEntryText]"|RollLoop --&ValidResults|+[$Roll.tableEntryText] --<| }}
you could just set it up as a deck instead of as a table.