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

Creating 1 Click Treasure Tables in Roll20

1636452398

Edited 1636453803
I imported via TableExport API these tables. <a href="https://drive.google.com/file/d/1PhSvZ7YMfLkE6YIxK9jmnCu318g96dos/view" rel="nofollow">https://drive.google.com/file/d/1PhSvZ7YMfLkE6YIxK9jmnCu318g96dos/view</a> Now i create a macro button for these tables. !rt /w gm &amp;{template:default} {{name=Treasure and Rewards}} {{Rewards Individual}} {{[Treas Ind CR0-4](!&amp;13; #Treas -I0-4) [Treas Ind CR5-10](!&amp;13; #Treas -I5-10) [Treas Ind CR11-16](!&amp;13; #Treas -I11-16) [Treas Ind CR17+](!&amp;13; #Treas -I17+) }} {{Rewards Horde}} {{[Treas Hrd CR0-4](!&amp;13; #Treas -H0-4) [Treas Hrd CR5-10](!&amp;13; #Treas -H5-10) [Treas Hrd CR11-16](!&amp;13; #Treas -H11-16) [Treas Hrd CR17+](!&amp;13; #Treas -H17+) }} It will show up as clickable buttons in the chat, but I can't click them. Anyone knows what im doing wrong? I use the RecursiveTable api script as well.
Already changed the&nbsp; !&amp;13; # &nbsp;in ! as well, still buttons not clickable. When I hover my mouse a little bit under it it lights up but still not clickable.
1636467130
The Aaron
Roll20 Production Team
API Scripter
If you run those macros directly, do you get the expected output?
1636469360

Edited 1636469772
I ran into this problem like a few days ago and solved it myself.&nbsp; Square breackets, Ats, and question marks have to be escaped on the otherside of apichat buttons.&nbsp; And when its an inline roll you just replace the outer square brackets.&nbsp; I think because of this recursive tables has issues with apichat buttons inside of other apichat buttons.&nbsp;&nbsp; Also be careful sharing tableexport stuff, the mods yell at us when we do.&nbsp; Make sure its definitely not copyrighted stuff.&nbsp; &nbsp; Nm Misassumed you used a different google doc.&nbsp; I believe your problem is you have the tables made and you have the main macro made but you have not made the individual macros for each table.&nbsp; So the API chat buttons are calling nothing.
You need to create a bunch of collection macros with these names: #Treas-I0-4 !rt /w gm &amp;{template:default} {{name=Individual Tier 1}} {{[[1t[Treasure-HrdCR0-4]]]}} #Treas-I5-10 !rt /w gm &amp;{template:default} {{name=Individual Tier 2}} {{[[1t[Treasure-HrdCR5-10]]]}} #Treas-I11-16 !rt /w gm &amp;{template:default} {{name=Individual Tier 3}} {{[[1t[Treasure-HrdCR11-16]]]}} etc...
If you'd like, I have a couple Google Docs with two versions of Treasure Tables for import into Roll20. Both have a table of 'nonmagical or slightly magical trinkets', and a spell scroll list.&nbsp; Standard DMG Tables Custom Treasure Tables Both are set up to use a 'Macro Mule' character (the DMG version is named 'Treasure' and the Custom version is named 'Loot'), so you'll have to cut and paste the portions on the 'Macros' sheet to be used on that character. The Custom Treasure Tables are my own interpretation of what I think the rollable treasure tables should look like to include magic items from Xanathar's Guide to Everything, Tasha's Cauldron of Everything, and Fizban's Treasury of Dragons.&nbsp; It's also more 'fleshed out' than the 'Standard DMG Tables' I listed, and includes references to which pages they are found on in physical books, which are links to D&amp;D Beyond for each item and spell that's listed. This is what the Chat Menu looks like: And here's an example output from a roll on the Tier 4 Horde looks like this: And here's a screenshot of the table I used to categorize items into their different tables:
TYVM Jarren!
1636804249

Edited 1636804383
Hey Jarren, First of all, thank you for sharing your tables. I do hope I don't bother you too much, if I have some questions, related to your macros. I wrote a small API-Script to create the "mule character" with the according abilities (I should add, I used the macros and tables from your "Custom Treasure Tables" document). Now I am encountering some strange behaviour, maybe you can say something about it, since I am not the macro and styling kind of person. The chat menu looks a little strange, since there is something off with the text color, as I said, I am not to familiar with styling: There seems to be something off with the macros, every macro after 500GP Gems is not working, when activated through above chat menu (I get the same style of error message for any button after 500GPGems): &nbsp;And the third thing is that some html styling behaves strange: If you could help me with that, that would be great! Also, of course I will happily share the "Mule Maker" script, once everything works. Best, Marco
I'm guessing that the Mule Maker script didn't import everything correctly - it's likely a regex issue, because it looks like some of the characters are not being imported correctly (e.g. the &lt;%%60%%&gt; is not being converted to a &lt; symbol). If you PM me a game invite (don't post game links publicly) I'd be happy to take a look.
1636960977

Edited 1636969221
I won't get any table, imported all the tables, but when I press the loot macro for the character a screen shows up with input value. Do I have to create 44 different macro's on the character ability sheet? I use the custom one btw.
I had the same issue as Marco, but I changed the html colour code for the font of the text in the chat menu to the same as the header.&nbsp; Additionally I have problems when clicking on the ‘Individual Treasure’ or the ‘Treasure Hoard’ section as it outputs the&nbsp; &lt;%%60%%&gt; throughout text.&nbsp; Otherwise it works great. I love that you linked the dndbeyond weblink for specific items when outputted in chat. Patrick, yes you have to add the 44 macros to the ‘Loot’ character ability sheet. A little copying and pasting to do haha.
Hello, Thx for sharing the Tables and Macros. I'm getting the exact same behavior : Marco R. said: Hey Jarren, First of all, thank you for sharing your tables. I do hope I don't bother you too much, if I have some questions, related to your macros. I wrote a small API-Script to create the "mule character" with the according abilities (I should add, I used the macros and tables from your "Custom Treasure Tables" document). Now I am encountering some strange behaviour, maybe you can say something about it, since I am not the macro and styling kind of person. The chat menu looks a little strange, since there is something off with the text color, as I said, I am not to familiar with styling: There seems to be something off with the macros, every macro after 500GP Gems is not working, when activated through above chat menu (I get the same style of error message for any button after 500GPGems): &nbsp;And the third thing is that some html styling behaves strange: If you could help me with that, that would be great! Also, of course I will happily share the "Mule Maker" script, once everything works. Best, Marco
1636997135

Edited 1636998370
I just tested it out in a fresh game and it worked for me, but I just realized that I forgot that modified TheAaron's TableExport script to properly deal with '&lt;' and '&gt;' symbols. You need to update the TableExport variable section starting on line 8 with this: var version = '0.2.4', lastUpdate = 1576529132, tableCache = {}, escapes = { // Added escapes for &lt; and &gt; '&lt;' : '&lt;%%60%%&gt;', '&gt;' : '&lt;%%62%%&gt;', '[' : '&lt;%%91%%&gt;', ']' : '&lt;%%93%%&gt;', '--' : '&lt;%-%&gt;', ' --' : '[TABLEEXPORT:ESCAPE]' }, I also see that some of the ability calls are actually being expanded before entered into the table items (e.g.&nbsp;%{Loot|RefStyle}), so I I'm going to update the script and macros really quickly and I'll repost here again. But in the meantime the current macros and everything work if you update TableExport with that change. I've updated the script again and the Google Doc in the next post below.
1636998318

Edited 1636998403
Update TableExport to this: var version = '0.2.4', lastUpdate = 1576529132, tableCache = {}, escapes = { // Added escapes for % and &lt; and &gt; '%' : '&lt;%%37%%&gt;', '&lt;' : '&lt;%%60%%&gt;', '&gt;' : '&lt;%%62%%&gt;', '[' : '&lt;%%91%%&gt;', ']' : '&lt;%%93%%&gt;', '--' : '&lt;%-%&gt;', ' --' : '[TABLEEXPORT:ESCAPE]' }, I updated the Google Doc tables as well to include the escapes for % symbols, so that the %{Loot|RefStyle} doesn't get expanded when imported into the table items.
Patrick M. said: I won't get any table, imported all the tables, but when I press the loot macro for the character a screen shows up with input value. Do I have to create 44 different macro's on the character ability sheet? I use the custom one btw. Yes, you will have to copy and paste the 44 macros onto a character called 'Loot'. That's just a one-time thing.&nbsp; I just did it in a fresh game and it took me maybe 5 minutes of Ctrl-C Ctrl-V copying and pasting from the Google Doc. It sounds like Marco is working on a script to simply build that character sheet, which would be great! (And beyond my abilities to do myself!). Now that I've remembered the update I had to make to TableExport, hopefully it will work for everyone.
Just added the changes you implemented and it works perfectly. Thanks again for the hard work Jarren!
Sam B. said: Just added the changes you implemented and it works perfectly. Thanks again for the hard work Jarren! Sweet! Also, I just updated the Treasure Tables tab (all of the LootIndiv# and LootHorde# tables), so that each 'Trinkets' reference and 'Magic Items A/B/C/D/E/F' reference are links to roll on those tables again, if you don't like the items that come up initially.
Jarren it's working now, if you got any updates just post them here. This work is tha bomb!
Thanks for sharing. I will try to find time this weekend and include all changes into the script I am working on, which I will happily share here. My plan is to make a map-icon character, which can include all tables as an action (use once per create game) and can be used to be placed on the map to generate treasure, when needed. So far I got all the steps done, just need to change the table codes as Jarren corrected them. Marco
1637352131
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you click on the "show in macro bar" on the token master action, you probably don't even need to place the token. The action will just be there.
Hi guys,&nbsp; so here goes nothing. I found the time to modify my script according to Jarren's hints and changes. You will find the main part here,&nbsp; on my gihub .&nbsp; First off, the heavy lifting was done by Jarren, who provided all of the tables, links, weights, macros, so basically everything. The second part of the work was done by drum roll &nbsp;The Aaron, with his TableExport and RecursiveTable scripts. My contribution is to copy&amp;paste all those things together and build something that is hopefully useful for more than just me. Let's get to the script now. Prerequisites: Install RecursiveTable form the 1-click. Either install ExportTable from the 1-click and modify it according to Jarrens post ( here ) OR just download the modified version from my git. Open the game and type&nbsp;&nbsp;&nbsp;&nbsp; !makeRandomLoot You should now, hopefully, see a new character called loot If you drag this on your map, the character will have two token actions When you do this the first time in your game, hit CreateTable, now all the random loot tables will be created. You will not need or want to use this action ever again in this game, best is to switch it off, so you don't hit it accidentally. Once the tables are created you can use the Chat Menu action, to get the nice menu Jarren created. I use the character to place it on the DM layer in my games at wherever random loot can be found, so I can just activate it form the map. If you don't want that, you can follow keithcurtis' advice ( here ), respectively. Please let me know, if the script works for you, in particular I somewhat expect, that the character will have no icon...since the link point into my collection, but then again it works in the case of doorKnocker, too. Let me know what happens. Marco
1637598648

Edited 1637606262
Great work, Marcos! I just tried it out in a brand new test game and it took me about 10 minutes total to get everything set up, but I noticed that the chat menu and links weren't being formatted correctly. I tracked it down to a very small typo on Line 8 of the MakeMacroMule script. The " and = were switched after 'style'.&nbsp; It should read like this: &nbsp; &nbsp; [`LinkStyle`,`" style =" background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`], Again, very nice!
Stupid mistake by me, I used search and replace to get rid of the extra&nbsp; quotes&nbsp; included after converting it all to the needed form, and then I did not check if my manual corrections were ... well.... correct. Thank's for trying it out and finding the typo, the update is now on github. Jarren said: Great work, Marcos! I just tried it out in a brand new test game and it took me about 10 minutes total to get everything set up, but I noticed that the chat menu and links weren't being formatted correctly. I tracked it down to a very small typo on Line 8 of the MakeMacroMule script. The " and = were switched after 'style'.&nbsp; It should read like this: &nbsp; &nbsp; [`LinkStyle`,`" style =" background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`], Again, very nice!
1637606445
Loren the GM
Pro
Marketplace Creator
Thanks for the work on this, everyone who has been involved across all the various scripts and documents! Trying to set this up and I'm also having strange formatting, similar to what was posted earlier. All links are showing up as white text. Process: Make new game. Installed the main MakeMacroMule script from your git . Double checked to make sure line 8 is correct [`LinkStyle`,`" style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`], Installed RecursiveTable from script library. Installed modified TableExport from your git . Double-checked to make sure lines 7-19 were the updated code var version = '0.2.4', lastUpdate = 1576529132, tableCache = {}, escapes = { // Added escapes for % and &lt; and &gt; '%' : '&lt;%%37%%&gt;', '&lt;' : '&lt;%%60%%&gt;', '&gt;' : '&lt;%%62%%&gt;', '[' : '&lt;%%91%%&gt;', ']' : '&lt;%%93%%&gt;', '--' : '&lt;%-%&gt;', ' --' : '[TABLEEXPORT:ESCAPE]' }, Marco R. said: Stupid mistake by me, I used search and replace to get rid of the extra&nbsp; quotes&nbsp; included after converting it all to the needed form, and then I did not check if my manual corrections were ... well.... correct. Thank's for trying it out and finding the typo, the update is now on github. Jarren said: Great work, Marcos! I just tried it out in a brand new test game and it took me about 10 minutes total to get everything set up, but I noticed that the chat menu and links weren't being formatted correctly. I tracked it down to a very small typo on Line 8 of the MakeMacroMule script. The " and = were switched after 'style'.&nbsp; It should read like this: &nbsp; &nbsp; [`LinkStyle`,`" style =" background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`],
One thing I've noticed is that occasionally one of the hoard rolls will return a simple '0' result for the magic item tables.&nbsp; I'm not sure why that is happening - it seems to happen on any of the magic items tables when they are part of a hoard roll, but not when I roll on those tables individually.&nbsp; And it's not every time. Is this a recursion limit thing, or something else that may be going on? I'm not sure how to go about troubleshooting it.&nbsp; I saw in the original RecursiveTables thread that it was noted by others, but I didn't see a resolution or workaround for it. I tried increasing the maxdepth all the way up to 90 as well, just to see if that would help, but it's still occurring. It's not a huge issue (and that's part &nbsp;of the reason I added the links back to be able to roll on the tables again), but it would be nice if it could be fixed. Thanks!&nbsp;
Thanks, solved that as well. If you just use the new version of my script (no need to rebuild the tables) and check it again. Thank you so much for testing! Loren the GM said: Thanks for the work on this, everyone who has been involved across all the various scripts and documents! Trying to set this up and I'm also having strange formatting, similar to what was posted earlier. All links are showing up as white text. Process: Make new game. Installed the main MakeMacroMule script from your git . Double checked to make sure line 8 is correct [`LinkStyle`,`" style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`], Installed RecursiveTable from script library. Installed modified TableExport from your git . Double-checked to make sure lines 7-19 were the updated code var version = '0.2.4', lastUpdate = 1576529132, tableCache = {}, escapes = { // Added escapes for % and &lt; and &gt; '%' : '&lt;%%37%%&gt;', '&lt;' : '&lt;%%60%%&gt;', '&gt;' : '&lt;%%62%%&gt;', '[' : '&lt;%%91%%&gt;', ']' : '&lt;%%93%%&gt;', '--' : '&lt;%-%&gt;', ' --' : '[TABLEEXPORT:ESCAPE]' }, Marco R. said: Stupid mistake by me, I used search and replace to get rid of the extra&nbsp; quotes&nbsp; included after converting it all to the needed form, and then I did not check if my manual corrections were ... well.... correct. Thank's for trying it out and finding the typo, the update is now on github. Jarren said: Great work, Marcos! I just tried it out in a brand new test game and it took me about 10 minutes total to get everything set up, but I noticed that the chat menu and links weren't being formatted correctly. I tracked it down to a very small typo on Line 8 of the MakeMacroMule script. The " and = were switched after 'style'.&nbsp; It should read like this: &nbsp; &nbsp; [`LinkStyle`,`" style =" background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block;`],
One more quick note: for the MakeMacroMule code, I must have updated the text coloring again after Marco created the list of templates, so for the appearance that I showed earlier lines 8-10 would be this: &nbsp; &nbsp; [`LinkStyle`,`" style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block; color: #404040; `], &nbsp; &nbsp; [`HeaderLinkStyle`,`%{Loot|LinkStyle}color: #7e2d40; font-weight: bold; display: block; text-align: center;`], &nbsp; &nbsp; [`ItemLinkStyle`,`%{Loot|LinkStyle} font-size: 10px; background-color: #F2F5D3; border: 1px solid black; padding:0px 2px; min-width: 8px; text-align: center; &nbsp; color: #ce0f69; `], But the nice part about putting the styles onto the macro mule character is that you can easily change them on the character sheet to whatever color you prefer!
1637611350

Edited 1637611428
Loren the GM
Pro
Marketplace Creator
Fixed, thanks! Had to delete the Loot character and run !makeRandomLoot again. It is indeed because the colors are set on that character sheet. (Or alternatively, I could have updated the character sheet with the style info as Jarren points out). Marco R. said: Thanks, solved that as well. If you just use the new version of my script (no need to rebuild the tables) and check it again. Thank you so much for testing!
&nbsp;I can not even begin to understand the problem on the level Scott C and Aaron are discussing it, four years back. Sorry I can't do anything on this side. Jarren said: One thing I've noticed is that occasionally one of the hoard rolls will return a simple '0' result for the magic item tables.&nbsp; I'm not sure why that is happening - it seems to happen on any of the magic items tables when they are part of a hoard roll, but not when I roll on those tables individually.&nbsp; And it's not every time. Is this a recursion limit thing, or something else that may be going on? I'm not sure how to go about troubleshooting it.&nbsp; I saw in the original RecursiveTables thread that it was noted by others, but I didn't see a resolution or workaround for it. I tried increasing the maxdepth all the way up to 90 as well, just to see if that would help, but it's still occurring. It's not a huge issue (and that's part &nbsp;of the reason I added the links back to be able to roll on the tables again), but it would be nice if it could be fixed. Thanks!&nbsp;