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

Roll query that rolls multiple times on a roll table

I have looked through multiple macro help guides and examples, as well as the forums and can't figure out if the syntax is wrong, or if what I'm trying to do is simply not currently possible. I did find one  kinda-related post , and the 3rd response is what I'm trying to do, but the poster didn't give enough detail for me to compare syntax. Anyway, I have a roll table Jewelry , and I want to create a macro that allows me to: Select a token Input how many times to roll on the Jewelry table Output the results to chat The following syntax kinda works, but it only outputs one roll on the Jewelry table no matter what value I enter for the roll query: @{target|token_name} finds the following jewelry: [[?{Number of jewelry items|1}t[Jewelry]]] Any help would be appreciated. :)
The inline roll brackets [[ ]] are condensing the results, if the table was just numbers it would be adding them. Since you want the results displayed separately you need to use the /r nomenclature. Try this. @{target|token_name} finds the following jewelry: /r ?{Number of jewelry items|1}t[Jewelry] It will put each item on a line separately in chat. Keep in mind that this won't work inside of a roll template because it needs a line break for the /r to work.
1501677680
The Aaron
Pro
API Scripter
Since you're a pro subscriber, you could use my  RecursiveTable script, which will expand inline table rolls into a list: @{target|token_name} finds the following jewelry: !rt [[?{Number of jewelry items|1}t[Jewelry]]]
^ The Aaron's witch magic
1501678466
The Aaron
Pro
API Scripter
MUHAHAHAHAHAHAHA
1501700375

Edited 1501700619
Ed S. said: Try this. @{target|token_name} finds the following jewelry: /r ?{Number of jewelry items|1}t[Jewelry] Thanks Ed S. for the explanation and the example. I actually did just this early on in my testing, but I didn't like the output at all (I'm a stickler for presentation) so I dismissed it as an option and forgot about it. DM Quicksilver (GM): Kib finds the following jewelry: rolling 3t[Jewelry] ( Gold ring with a large, round, amethyst + Gold pendant with four square fluorites arranged in a square + Hexagonal gold pendant bearing the image of a king) = 0 Thanks again for being helpful.
1501701541
The Aaron
Pro
API Scripter
Using RecursiveTables will probably give you the format you want. Something like: Gold ring with a large, round, amethyst, Gold pendant with four square fluorites arranged in a square,  Hexagonal gold pendant bearing the image of a king It will even let you format it to work with roll templates. =D
1501704801

Edited 1501707595
The Aaron said: Since you're a pro subscriber, you could use my  RecursiveTable script, which will expand inline table rolls into a list: @{target|token_name} finds the following jewelry: !rt [[?{Number of jewelry items|1}t[Jewelry]]] Thanks The Aaron for pointing out this (fairly recent?) script option you wrote. I have the following working: @{target|token_name} finds the following jewelry: !rt[Delimiter:BR] &{template:default} {{name=Jewelry}} {{items found=[[?{Number of jewelry items|1}t[Jewelry]]]}} So it works for what I asked helped with, and looks pretty decent overall. Thanks for that. However, I have a couple of questions/suggestions for the RecursiveTable script. The Delimiter option seems to be pretty limited; your doc doesn't seem to specify, but it appears to be limited to a single character (other than "BR"). "BR" doesn't allow any white space or other delimiting characters with it. For example I'd like to use something like BRBR to put a visual break between each result, or to conserve space do something like BR" - " to allow this kind of output: - First item - Second item with has a much longer desription - Third item I didn't see this script listed in the script library when I went to add it to my campaign, so I went to GIT and grabbed your script there. Are you planning to get this added to the script library anytime soon? Also, (and I realize I'm straying even further off topic here, so I'll post the rest in the  API forum ). P.S. Why the heck isn't my <pre> tag working above (I'm trying to properly post the macro code)?
1501708308
The Aaron
Pro
API Scripter
Fixed your formatting. &nbsp;This will help: &nbsp; <a href="https://wiki.roll20.net/Forum_Posting#Formatting_a" rel="nofollow">https://wiki.roll20.net/Forum_Posting#Formatting_a</a>... Delimiter supports multiple characters, but there isn't a way to specify BR multiple times. &nbsp;I'll see if I can come up with a better way to handle that. Maybe let you put %%BR%% wherever you want a &lt;BR&gt;, something like: !rt[Delimiter:%%BR%% - ] some roll As for scripts in the 1-click, it's just a lack of time getting them ready for it on my part. &nbsp;I keep thinking I'll go through and do them all in one go, but there are several extra steps to go through to get it set up and I keep thinking I'll automate it as part of my release management system. &nbsp;The updates are relatively easy for one script, but I've got a few more than that... I'll go hit your other question on it's new post. =D
The Aaron said: Fixed your formatting. &nbsp;This will help: &nbsp; <a href="https://wiki.roll20.net/Forum_Posting#Formatting_a" rel="nofollow">https://wiki.roll20.net/Forum_Posting#Formatting_a</a>... Thanks...didn't realize it was in the paragraph options...was referencing&nbsp; this page trying to figure out the formatting and tried both the &lt;code&gt; and &lt;pre&gt; tags to no avail. The Aaron said: Delimiter supports multiple characters, but there isn't a way to specify BR multiple times. &nbsp;I'll see if I can come up with a better way to handle that. Maybe let you put %%BR%% wherever you want a &lt;BR&gt;, something like: !rt[Delimiter:%%BR%% - ] some roll Thanks for looking into a way to do multiple line breaks. Testing again shows the the delimiter indeed accepts multiple characters, just not spaces (like " - "), in which case it defaults back to using ",". Maybe I found a bug? The Aaron said: s for scripts in the 1-click, it's just a lack of time getting them ready for it on my part. &nbsp;I keep thinking I'll go through and do them all in one go, but there are several extra steps to go through to get it set up and I keep thinking I'll automate it as part of my release management system. &nbsp;The updates are relatively easy for one script, but I've got a few more than that. I understand resource/time constraints. Thanks for all you do for the community....quite a long list. Perhaps if you didn't have to reply to so many posts like mine you could get to the actual scripting. :) Cheers The Aaron!
1501711571
The Aaron
Pro
API Scripter
Hahahahah! &nbsp;Probably more a function of having 8 kids and too much work to do. =D &nbsp;Answering forum questions is my way of relaxing between tough things. =D That page is for formatting the wiki pages. No spaces eh? Sounds like a bug...