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

[SCRIPT] AUTO SHOP GENERATOR

Hi, so I recently become a DM, 6 months ago and start using roll20. And I discovered that API really makes the DM's life easier. And I always had the problem arranging a store for my players, and I decided to create a script that generates a store based on the city and type of store, and it also will generate the quantity of items randomly based on the type of city and sometimes will apply a tax or discount.&nbsp; So after watching a video of Nick Olivo, on youtube where he explains how to create a handout with a script, I decided to modify this a bit more to in order to help me with my problem. I also had to find a list of all the magic items, which I found on reddit&nbsp; (<a href="https://docs.google.com/spreadsheets/d/1YPjicBYONAtoduyoamiwlVpsV_k1Ki2XzNCAnar5d4Y/edit#gid=0" rel="nofollow">https://docs.google.com/spreadsheets/d/1YPjicBYONAtoduyoamiwlVpsV_k1Ki2XzNCAnar5d4Y/edit#gid=0</a>) and use the api to export rollable tables into roll20. So basically what the script does is to read the rollable, and see if the item belongs to the type of store or not, it also checks its rarity and depending of this, it will list it on the store.&nbsp; Which looks like this:&nbsp; <a href="https://i.imgur.com/qfEOmN3.png" rel="nofollow">https://i.imgur.com/qfEOmN3.png</a> &nbsp;after finding some images on pinterest(<a href="https://www.pinterest.com/pin/530861874796602248/" rel="nofollow">https://www.pinterest.com/pin/530861874796602248/</a>,&nbsp; <a href="https://www.pinterest.com/pin/2462974786528459/" rel="nofollow">https://www.pinterest.com/pin/2462974786528459/</a>, &nbsp; <a href="https://www.pinterest.com/pin/4855512089007765/" rel="nofollow">https://www.pinterest.com/pin/4855512089007765/</a>) &nbsp; Here is the script (<a href="https://github.com/alexisqc92/roll20/blob/master/shopMaker.js" rel="nofollow">https://github.com/alexisqc92/roll20/blob/master/shopMaker.js</a>), if anyone would like to use it. And if anyone know how I can make the script read a css file in order to make the code look a bit nicer.
This looks like a cool idea, but there is some difficulty setting it up without the rollable table. What format does the "ItemList" table need to take for this script to read it? Maybe you could you screencap/paste/export an example table or two?
Glenn, the format is in the following link :&nbsp; <a href="https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt" rel="nofollow">https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt</a> , to import the table to roll20 I used TableExport API with that format and then I was able to read it.
Alexisqc92 said: Glenn, the format is in the following link :&nbsp; <a href="https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt" rel="nofollow">https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt</a> , to import the table to roll20 I used TableExport API with that format and then I was able to read it. Hi, The table you're creating with this list is called ItemShop, with the I and S capitalised, but for all of the different items going into the table are named itemshop without the i and the s capitalised, this will cause a lot of error messages when you run TableExport as it will try to add the item to the table itemshop not ItemShop but will create a table with the name ItemShop with no items in it.
Aaron M. said: Alexisqc92 said: Glenn, the format is in the following link :&nbsp; <a href="https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt" rel="nofollow">https://github.com/alexisqc92/roll20/blob/master/ItemShop_Table.txt</a> , to import the table to roll20 I used TableExport API with that format and then I was able to read it. Hi, The table you're creating with this list is called ItemShop, with the I and S capitalised, but for all of the different items going into the table are named itemshop without the i and the s capitalised, this will cause a lot of error messages when you run TableExport as it will try to add the item to the table itemshop not ItemShop but will create a table with the name ItemShop with no items in it. Hi, Aron thanks, yes you are right, it was a mistake while was uploading the file. But after modifying to the same name, it will upload everything.