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] Magic Item Store (reworked)

1650618939

Edited 1650730248
Julexar
Pro
API Scripter
Alright, so recently I found the beautifully done Magic Item Store API made by&nbsp; <a href="https://app.roll20.net/users/1165285/kirsty" rel="nofollow">https://app.roll20.net/users/1165285/kirsty</a> &nbsp;and I figured I'd improve upon it a little. All credits go to Kirsty as this is NOT my code and I only added a few extra features. Github Repository New Features I added Minimum and Maximum Rarity so that you can now have a variety of items across multiple rarities and updated the way the rarity is calculated to fit a bit better. I added Mundane Items that were previously missing. I fixed the "Show to Players" button as that wasn't working previously. How to Use
Julexar, Thanks for this update, I wrote to Kristy but I don't think she is in rol20 anymore. Anyway I test this version and it crash the sandbox when the minimum rarity is set to rare. this is what I get when I set the min. rarity to Rare Also, do you think that an option to select the items to make the shop could be added. For example if I select the rare list that I can select the items that I want to be added to the shop. If not there is no problem.&nbsp; Thanks for updating this API is really useful.
Hi Julexar, Please disregard the first part of my message, the mistake was mine. I copy your version without deleting the old version. Is working perfect. Let me know If you can add the functionality to have a list of the items and select them manually. Again thanks for the update. 👍👍
1650638812
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hey Warlord! Do you have a link to a description of how the script works? The code lists a couple of commands, but if Kirsty started a thread that gave some documentation, that would be very useful.
It crashed on my side when i asked for a random 5 items from common to very rare :&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was: ReferenceError: randomInt is not defined ReferenceError: randomInt is not defined at getItem (apiscript.js:46506:17) at getInventory (apiscript.js:45861:35) at handleInput (apiscript.js:45741:21) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
Basically, you type !ms to get a menu of the shop&nbsp; after, you press any of the categories and various prompt will pop up. First will be the qty of items you want on the shop, second will be the min. rarity, and last will be the max. rarity. after that it will give you a list like the one above with a random list of items base on the category you selected. If you select random it will take all the categories into account and give you items from any of the list. when you are happy with your shop just press the "show to player" and it will show the shop to the players. I hope this help. I found this a long time ago. There is no documentation in the first thread only the instruction on the script. I hope this help. Also I recreate the crash I can confirm it happens when you try Items, from common to uncommon. &nbsp;
@keithcurtis &nbsp;was able to fine the thread were Kristy mention this script, is from 4 years ago. I add the link but I does not have more documentation than what I wrote earlier. <a href="https://app.roll20.net/forum/post/6368770/5e-shopping-in-campaigns-any-advice-on-how-to-make-it-easier-for-me" rel="nofollow">https://app.roll20.net/forum/post/6368770/5e-shopping-in-campaigns-any-advice-on-how-to-make-it-easier-for-me</a>
1650643482
Julexar
Pro
API Scripter
Warlord said: Julexar, Thanks for this update, I wrote to Kristy but I don't think she is in rol20 anymore. Anyway I test this version and it crash the sandbox when the minimum rarity is set to rare. this is what I get when I set the min. rarity to Rare Also, do you think that an option to select the items to make the shop could be added. For example if I select the rare list that I can select the items that I want to be added to the shop. If not there is no problem.&nbsp; Thanks for updating this API is really useful. Hey Warlord, would you mind telling me when this error occurs? Does it only occur if you choose a certain option or does it happen for every option?
1650643673
Julexar
Pro
API Scripter
Warlord said: Hi Julexar, Please disregard the first part of my message, the mistake was mine. I copy your version without deleting the old version. Is working perfect. Let me know If you can add the functionality to have a list of the items and select them manually. Again thanks for the update.  Hmm, this might be possible but is beyond my capabilities. But if you want, you can rig the chances to give you more of certain items
1650644280

Edited 1650644306
Julexar
Pro
API Scripter
Lionel V. said: It crashed on my side when i asked for a random 5 items from common to very rare :&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was: ReferenceError: randomInt is not defined ReferenceError: randomInt is not defined at getItem (apiscript.js:46506:17) at getInventory (apiscript.js:45861:35) at handleInput (apiscript.js:45741:21) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) Which items did you try to get (Weapons, Armor, Scrolls, etc)?
Lionel V. &nbsp;said: It crashed on my side when i asked for a random 5 items from common to very rare :&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again.&nbsp; More info... &nbsp;If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was:&nbsp; ReferenceError: randomInt is not defined ReferenceError: randomInt is not defined at getItem (apiscript.js:46506:17) at getInventory (apiscript.js:45861:35) at handleInput (apiscript.js:45741:21) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) Which items did you try to get (Weapons, Armor, Scrolls, etc)? The crash occurs when you select "Items" and select min. rarity: common and Max. Rarity: uncommon. basically all combinations apart from Common, Common.
Julexar said: Lionel V. said: It crashed on my side when i asked for a random 5 items from common to very rare :&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was: ReferenceError: randomInt is not defined ReferenceError: randomInt is not defined at getItem (apiscript.js:46506:17) at getInventory (apiscript.js:45861:35) at handleInput (apiscript.js:45741:21) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) Which items did you try to get (Weapons, Armor, Scrolls, etc)? I pressed on a random, and chose 5 items from common to very rare
1650703266
Julexar
Pro
API Scripter
Warlord said: Lionel V. &nbsp;said: It crashed on my side when i asked for a random 5 items from common to very rare :&nbsp; Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again.&nbsp; More info... &nbsp;If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was:&nbsp; ReferenceError: randomInt is not defined ReferenceError: randomInt is not defined at getItem (apiscript.js:46506:17) at getInventory (apiscript.js:45861:35) at handleInput (apiscript.js:45741:21) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) Which items did you try to get (Weapons, Armor, Scrolls, etc)? The crash occurs when you select "Items" and select min. rarity: common and Max. Rarity: uncommon. basically all combinations apart from Common, Common. Thanks for letting me know. I updated the code and it shouldn't crash anymore.
Still Crashing for me. randomInt is not defined... Also, how do you reset the shop ? When i send !ms it only shows 5 scrolls and that's it. Doesn't come back to the full shop
1650711889

Edited 1650712131
Julexar
Pro
API Scripter
Lionel V. said: Still Crashing for me. randomInt is not defined... Also, how do you reset the shop ? When i send !ms it only shows 5 scrolls and that's it. Doesn't come back to the full shop Did you grab the new code from my Repository? The store always shows the last shop that you made (e.g. you create a shop with 5 scrolls, if you do !ms again, it will show the exact same shop). If you want an empty inventory, simply do !ms_inventory
1650713781
Julexar
Pro
API Scripter
keithcurtis said: Hey Warlord! Do you have a link to a description of how the script works? The code lists a couple of commands, but if Kirsty started a thread that gave some documentation, that would be very useful. A description/guide is now also included in the&nbsp; Github Repository
Julexar said: Lionel V. said: Still Crashing for me. randomInt is not defined... Also, how do you reset the shop ? When i send !ms it only shows 5 scrolls and that's it. Doesn't come back to the full shop Did you grab the new code from my Repository? The store always shows the last shop that you made (e.g. you create a shop with 5 scrolls, if you do !ms again, it will show the exact same shop). If you want an empty inventory, simply do !ms_inventory Yup it works with the new code. So it's not possible to turn back to original shop (as when you hit !ms for the very first time) ? Also, from the original shop, would be nice if you could sort all items by category (show all potions, show all scrolls...)&nbsp; And lastly, can't find the guide in repository :(
1650721169
Julexar
Pro
API Scripter
Lionel V. said: Julexar said: Lionel V. said: Still Crashing for me. randomInt is not defined... Also, how do you reset the shop ? When i send !ms it only shows 5 scrolls and that's it. Doesn't come back to the full shop Did you grab the new code from my Repository? The store always shows the last shop that you made (e.g. you create a shop with 5 scrolls, if you do !ms again, it will show the exact same shop). If you want an empty inventory, simply do !ms_inventory Yup it works with the new code. So it's not possible to turn back to original shop (as when you hit !ms for the very first time) ? Also, from the original shop, would be nice if you could sort all items by category (show all potions, show all scrolls...)&nbsp; And lastly, can't find the guide in repository :( Well, technically it could be possible to go back to the first shop but for that you could also scroll back to that message. I can add the option to sort by category. The guide should be in the wiki.
1650722041
Julexar
Pro
API Scripter
Lionel V. said: Julexar said: Lionel V. said: Still Crashing for me. randomInt is not defined... Also, how do you reset the shop ? When i send !ms it only shows 5 scrolls and that's it. Doesn't come back to the full shop Did you grab the new code from my Repository? The store always shows the last shop that you made (e.g. you create a shop with 5 scrolls, if you do !ms again, it will show the exact same shop). If you want an empty inventory, simply do !ms_inventory Yup it works with the new code. So it's not possible to turn back to original shop (as when you hit !ms for the very first time) ? Also, from the original shop, would be nice if you could sort all items by category (show all potions, show all scrolls...)&nbsp; And lastly, can't find the guide in repository :( Would you mind opening a Issue (Feature request) on the Github for the filtering?
1650725561
Andreas J.
Forum Champion
Sheet Author
Translator
So it's designed to work with the D&amp;D 5E sheet, how much work would be needed to make it work with other sheets?
1650725735
Julexar
Pro
API Scripter
Andreas J. said: So it's designed to work with the D&amp;D 5E sheet, how much work would be needed to make it work with other sheets? Well, for other games I would need a list of the Items, Scrolls, Weapons, Armour etc but other than that the Code should work. The only thing that would really need updating are all the lists that are in the Script.
1650727265
Julexar
Pro
API Scripter
If you would like me to make a version for another Sheet, maybe PM me so that we can discuss about the Details
1650816208
Julexar
Pro
API Scripter
Update The error has been fixed. Some improvements have been made.
1652011735
Julexar
Pro
API Scripter
Update Small improvements Added comments to make adding custom content easier
Hi, is the updated version the V1.3 released 15 days ago on GitHub?
1652197194
Julexar
Pro
API Scripter
Sam B. said: Hi, is the updated version the V1.3 released 15 days ago on GitHub? Yes, it is, I just forgot to make a post here
Hi Julexar - curious by any chance do you have Kristy API - General Loot?
1656841282
Julexar
Pro
API Scripter
Nover C. said: Hi Julexar - curious by any chance do you have Kristy API - General Loot? I do not but I might look into that in the future
1657288879
Nick O.
Forum Champion
This is a neat script! One weird thing I'm encountering, though, is that the menu of items is always displayed twice in chat. When logged in as the GM, I enter !ms and the menu from Item store is whispered twice, and is also displayed twice when I click the "Show to Players Button." I'm using version 1.3 of the script. Please let me know if there's any other information I can give that would be helpful.
1657295176
timmaugh
Pro
API Scripter
Julexar said: Andreas J. said: So it's designed to work with the D&amp;D 5E sheet, how much work would be needed to make it work with other sheets? Well, for other games I would need a list of the Items, Scrolls, Weapons, Armour etc but other than that the Code should work. The only thing that would really need updating are all the lists that are in the Script. Instead of hardcoding it, what about an import process giving a way for people to get their own data in? Reading contents from a handout? If you don't want to parse the text yourself, just require it to be in JSON format, within whatever structure you require.
1657392816
Julexar
Pro
API Scripter
timmaugh said: Julexar said: Andreas J. said: So it's designed to work with the D&amp;D 5E sheet, how much work would be needed to make it work with other sheets? Well, for other games I would need a list of the Items, Scrolls, Weapons, Armour etc but other than that the Code should work. The only thing that would really need updating are all the lists that are in the Script. Instead of hardcoding it, what about an import process giving a way for people to get their own data in? Reading contents from a handout? If you don't want to parse the text yourself, just require it to be in JSON format, within whatever structure you require. Sure, I might do that eventually. Currently working on recoding them a bit, so will probably add that
1657392878
Julexar
Pro
API Scripter
Nick O. said: This is a neat script! One weird thing I'm encountering, though, is that the menu of items is always displayed twice in chat. When logged in as the GM, I enter !ms and the menu from Item store is whispered twice, and is also displayed twice when I click the "Show to Players Button." I'm using version 1.3 of the script. Please let me know if there's any other information I can give that would be helpful. Thanks for the Information, I will look into it and fix it.
Here you go Julexar Seems I deleted the game that had my modified list but this is the original code havent tested this in 2+ years, but seeing you've used Kristy work and enjoyed her stuff, you might like this. I dont think she officially published this when I was in communication with her at the time. Perhaps more can be done with this wonderful script. // Loot generator for D&amp;D 5e // Created by Kirsty (<a href="https://app.roll20.net/users/1165285/kirsty" rel="nofollow">https://app.roll20.net/users/1165285/kirsty</a>) // API Commands: // !genLoot - Pulls up the menu and allows the GM to generate random loot // Red Colour: #7E2D40 var LootGenerator = LootGenerator || (function() { 'use strict'; var version = '1.0.2', handleInput = function(msg) { var args = msg.content.split(","); if (msg.type !== "api") { return; } if(playerIsGM(msg.playerid)){ switch(args[0]) { case '!genLoot': lootMenu(); break; case '!showLoot': showLoot(msg); break; } } }, lootMenu = function() { var colour = '#7E2D40'; var divstyle = 'style="width: 189px; border: 1px solid black; background-color: #ffffff; padding: 5px;"'; var astyle1 = 'style="text-align:center; border: 1px solid black; margin: 1px; padding: 2px; background-color: ' + colour + '; border-radius: 4px; box-shadow: 1px 1px 1px #707070; width: 100px;'; var astyle2 = 'style="text-align:center; border: 1px solid black; margin: 1px; padding: 2px; background-color: ' + colour + '; border-radius: 4px; box-shadow: 1px 1px 1px #707070; width: 150px;'; var arrowstyle = 'style="border: none; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 195px solid ' + colour + '; margin-bottom: 2px; margin-top: 2px;"'; var headstyle = 'style="color: ' + colour + '; font-size: 18px; text-align: left; font-variant: small-caps; font-family: Times, serif;"'; var substyle = 'style="font-size: 11px; line-height: 13px; margin-top: -2px; font-style: italic;"'; sendChat('Loot Generator', '/w gm &lt;div ' + divstyle + '&gt;' + //-- '&lt;div ' + headstyle + '&gt;Loot Generator&lt;/div&gt;' + //-- '&lt;div ' + substyle + '&gt;Menu (v.' + version + ')&lt;/div&gt;' + //-- '&lt;div ' + arrowstyle + '&gt;&lt;/div&gt;' + //-- '&lt;div style="text-align:center;"&gt;&lt;a ' + astyle2 + '" href="!showLoot,?{Challenge Rating|0-4,individual0|5-10,individual5|11-16,individual11|17+,individual17},?{Number of Enemies|1}"&gt;Individual Loot&lt;/a&gt;&lt;/div&gt;' + //-- '&lt;/div&gt;' ); }, showLoot = function(msg) { var args = msg.content.split(","); var totalLoot; switch(args[1]) { case 'individual0': totalLoot = individual0(msg); break; case 'individual5': totalLoot = individual5(msg); break; case 'individual11': totalLoot = individual11(msg); break; case 'individual17': totalLoot = individual17(msg); break; } var colour = '#7E2D40'; var divstyle = 'style="width: 189px; border: 1px solid black; background-color: #ffffff; padding: 5px;"' var astyle1 = 'style="text-align:center; border: 1px solid black; margin: 1px; padding: 2px; background-color: ' + colour + '; border-radius: 4px; box-shadow: 1px 1px 1px #707070; width: 100px;'; var astyle2 = 'style="text-align:center; border: 1px solid black; margin: 1px; padding: 2px; background-color: ' + colour + '; border-radius: 4px; box-shadow: 1px 1px 1px #707070; width: 150px;'; var tablestyle ='style="text-align:center; font-size: 12px; width: 100%"'; var arrowstyle = 'style="border: none; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 195px solid ' + colour + '; margin-bottom: 2px; margin-top: 2px;"'; var headstyle = 'style="color: ' + colour + '; font-size: 18px; text-align: left; font-variant: small-caps; font-family: Times, serif;"'; var substyle = 'style="font-size: 11px; line-height: 13px; margin-top: -2px; font-style: italic;"'; var trstyle = 'style="border-top: 1px solid #cccccc;"'; var tdstyle1 = 'style="text-align: left; width: 60px;"'; var tdstyle2 = 'style="text-align: left; padding-right: 10px;"'; var coins = totalLoot.split(";"); var loot = ''; var i = 0; var n = coins.length - 1; for (i = 0; i &lt; n; i ++) { var number = Number([i])+1 loot += '&lt;tr ' + trstyle + '&gt;&lt;td ' + tdstyle1 + '&gt;Enemy ' + number + '&lt;/td&gt;&lt;td ' + tdstyle2 + '&gt;' + coins[i] + getItem() + '&lt;/td&gt;&lt;/tr&gt;'; } loot += '&lt;tr ' + trstyle + '&gt;&lt;td ' + tdstyle1 + '&gt;Total Coins&lt;/td&gt;&lt;td ' + tdstyle2 + '&gt;' + coins[n] + '&lt;/td&gt;&lt;/tr&gt;'; sendChat('Loot', '&lt;div ' + divstyle + '&gt;' + //-- '&lt;div ' + headstyle + '&gt;Loot&lt;/div&gt;' + //-- '&lt;div ' + arrowstyle + '&gt;&lt;/div&gt;' + //-- '&lt;table ' + tablestyle + '&gt;' + //-- '&lt;tr&gt;&lt;th&gt;Enemy&lt;/th&gt;&lt;th&gt;Loot&lt;/th&gt;&lt;/tr&gt;' + //-- loot + //-- '&lt;/table&gt;'+ //-- '&lt;/div&gt;' ); }, getItem = function() { var itemList = 'lint,a potion of Minor healing,blue quartz (10 gp), stale bread, fresh bread, moldy cheese, a unknown potion, a bag of caltrop, abacus, a bag of ball bearing, bell, glass bottle, book, bedroll, blanket, candle, chalk, crowbar, fishing tackle, hammer, a random kit, a random holy symbol, holy water, hourglass, hunting trap, manacle, chains, rope 10ft, rope 15ft, rope 20ft, rope 25ft, rope 30ft, rope 50ft, jug, pitcher, flask, waterskin, lock, perfume, parchment, ink &amp; quill, miners pick, piton, Ration [[1d7]], soap, spyglass, tinderbox, wheatstone, dice set, card set, a random musical instrument, a trinket [[1d100]]' .split(","); var item = ''; var check = randomInteger(5); if (check&lt;2){ var num = randomInteger(3); var i = 0; for (i = 0; i &lt; num; i ++) { item += ', '; var roll = Number(randomInteger(itemList.length))-1; item += itemList[roll]; } } return item; }, individual0 = function(msg) { var args = msg.content.split(","); var noEnemies = args[2]; var loot = ''; var totpp = 0; var totgp = 0; var totep = 0; var totsp = 0; var totcp = 0; var i = 0; for (i = 0; i &lt; noEnemies; i ++) { var roll = randomInteger(100); if (i&gt;0){loot += ';'} if (roll&lt;31){ var cp = randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6); totcp += cp; loot += cp + ' cp'; }else if (30&lt;roll &amp;&amp; roll&lt;61){ var sp = randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6); totsp += sp; loot += sp + ' sp'; }else if (60&lt;roll &amp;&amp; roll&lt;71){ var ep = randomInteger(6)+randomInteger(6)+randomInteger(6); totep += ep; loot += ep + ' ep'; }else if (70&lt;roll &amp;&amp; roll&lt;96){ var gp = randomInteger(6)+randomInteger(6)+randomInteger(6); totgp += gp; loot += gp + ' gp'; }else if (95&lt;roll &amp;&amp; roll&lt;101){ var pp = randomInteger(6); totpp += pp; loot += pp + ' pp'; } } loot += ';' + totpp + " pp, " + totgp + " gp, " + totep + " ep, " + totsp + " sp, " + totcp + " cp"; return loot; }, individual5 = function(msg) { var args = msg.content.split(","); var noEnemies = args[2]; var loot = ''; var totpp = 0; var totgp = 0; var totep = 0; var totsp = 0; var totcp = 0; var i = 0; for (i = 0; i &lt; noEnemies; i ++) { var roll = randomInteger(100); if (i&gt;0){loot += ';'} if (roll&lt;31){ var ep = randomInteger(6)*10; totep += ep; loot += ep + ' ep, '; var cp = (randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6))*100; totcp += cp; loot += cp + ' cp'; }else if (30&lt;roll &amp;&amp; roll&lt;61){ var gp = (randomInteger(6)+randomInteger(6))*10; totgp += gp; loot += gp + ' gp, '; var sp = (randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6))*10; totsp += sp; loot += sp + ' sp'; }else if (60&lt;roll &amp;&amp; roll&lt;71){ var gp = (randomInteger(6)+randomInteger(6))*10; totgp += gp; loot += gp + ' gp, '; var ep = (randomInteger(6)+randomInteger(6)+randomInteger(6))*10; totep += ep; loot += ep + ' ep'; }else if (70&lt;roll &amp;&amp; roll&lt;96){ var gp = (randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6))*10; totgp += gp; loot += gp + ' gp'; }else if (95&lt;roll &amp;&amp; roll&lt;101){ var pp = randomInteger(6)+randomInteger(6)+randomInteger(6); totpp += pp; loot += pp + ' pp, '; var gp = (randomInteger(6)+randomInteger(6))*10; totgp += gp; loot += gp + ' gp'; } } loot += ';' + totpp + " pp, " + totgp + " gp, " + totep + " ep, " + totsp + " sp, " + totcp + " cp"; return loot; }, individual11 = function(msg) { var args = msg.content.split(","); var noEnemies = args[2]; var loot = ''; var totpp = 0; var totgp = 0; var totep = 0; var totsp = 0; var totcp = 0; var i = 0; for (i = 0; i &lt; noEnemies; i ++) { var roll = randomInteger(100); if (i&gt;0){loot += ';'} if (roll&lt;21){ var gp = randomInteger(6)*100; totgp += gp; loot += gp + ' gp, '; var sp = (randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6))*100; totsp += sp; loot += sp + ' sp'; }else if (20&lt;roll &amp;&amp; roll&lt;36){ var gp = randomInteger(6)*100; totgp += gp; loot += gp + ' gp, '; var ep = randomInteger(6)*100; totep += ep; loot += ep + ' ep'; }else if (35&lt;roll &amp;&amp; roll&lt;76){ var pp = randomInteger(6)*10; totpp += pp; loot += pp + ' pp, '; var gp = (randomInteger(6)+randomInteger(6))*100; totgp += gp; loot += gp + ' gp'; }else if (75&lt;roll &amp;&amp; roll&lt;101){ var pp = (randomInteger(6)+randomInteger(6))*10; totpp += pp; loot += pp + ' pp, '; var gp = (randomInteger(6)+randomInteger(6))*100; totgp += gp; loot += gp + ' gp'; } } loot += ';' + totpp + " pp, " + totgp + " gp, " + totep + " ep, " + totsp + " sp, " + totcp + " cp"; return loot; }, individual17 = function(msg) { var args = msg.content.split(","); var noEnemies = args[2]; var loot = ''; var totpp = 0; var totgp = 0; var totep = 0; var totsp = 0; var totcp = 0; var i = 0; for (i = 0; i &lt; noEnemies; i ++) { var roll = randomInteger(100); if (i&gt;0){loot += ';'} if (roll&lt;16){ var gp = (randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6)+randomInteger(6))*100; totgp += gp; loot += gp + ' gp, '; var ep = (randomInteger(6)+randomInteger(6))*1000; totep += ep; loot += ep + ' ep'; }else if (15&lt;roll &amp;&amp; roll&lt;56){ var pp = randomInteger(6)*100; totpp += pp; loot += pp + ' pp, '; var gp = randomInteger(6)*1000; totgp += gp; loot += gp + ' gp'; }else if (55&lt;roll &amp;&amp; roll&lt;101){ var pp = (randomInteger(6)+randomInteger(6))*100; totpp += pp; loot += pp + ' pp, '; var gp = randomInteger(6)*1000; totgp += gp; loot += gp + ' gp'; } } loot += ';' + totpp + " pp, " + totgp + " gp, " + totep + " ep, " + totsp + " sp, " + totcp + " cp"; return loot; }, registerEventHandlers = function() { on('chat:message', handleInput); }; return { RegisterEventHandlers: registerEventHandlers }; }()); on("ready",function(){ 'use strict'; LootGenerator.RegisterEventHandlers(); });
Only thing that was annoying was the usage of EP coins
1657470043
Julexar
Pro
API Scripter
Novercalis said: Only thing that was annoying was the usage of EP coins Yeah, I think I might be able to add some little extras and improve on it.
1657470234
Julexar
Pro
API Scripter
As stated though, I am currently working on recoding the other Scripts (like adding multi-world functionality to the Calendar etc) But I will definitely put it on my To-Do list
1660406332
Julexar
Pro
API Scripter
Dev Update Alright y'all, I got some very exciting News. Recently I have discovers a way that will allow me to implement the multiple Stores feature request. I am not sure when it will be ready for release but I will definitely post an Update here once it is. If you would like the changes so far, simply click the link below: GitHub Repository
awesome! I will give it a look sometime next week
1660496831
Julexar
Pro
API Scripter
Here's a link to the new Commands that the API will be using once the Version is released: GitHub Wiki
1664813345
Julexar
Pro
API Scripter
Version 1.5+ moved to the following thread