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] Turn Tracker - Adding a random number

Trying to use ACT to add custom items to the turn tracker <a href="https://app.roll20.net/forum/post/3346285/script-turn-tracker-automatically-add-custom-item-w-slash-round-calculations/?pageforid=3346527#post-3346527" rel="nofollow">https://app.roll20.net/forum/post/3346285/script-turn-tracker-automatically-add-custom-item-w-slash-round-calculations/?pageforid=3346527#post-3346527</a> I'm trying to add a random number as the 1st parameter but all it does is add 0 to the turn tracker !act +[[1d20+2]] 0 --Aurora And half the time the sandbox crashes when I try this. 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 Mod Library, you might find help in the Community API Forum. For reference, the error message generated was: RangeError: Maximum call stack size exceeded at Function.each (/home/node/d20-api-server/node_modules/underscore/underscore-node-f.cjs:1323:7) at processMultiOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:804:7) at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:1128:4) at sendChat (/home/node/d20-api-server/api.js:1897:16) at makeAndSendMenu (apiscript.js:26219:9) at nextRound (apiscript.js:25966:13) at doTurnorderChange (apiscript.js:25801:17) at nextTurn (apiscript.js:25940:9) at nextRound (apiscript.js:25976:13) at doTurnorderChange (apiscript.js:25801:17)
1659367753
The Aaron
Roll20 Production Team
API Scripter
Hmm. That should work, but try it without the + and see if that works? !act [[1d20+2]] 0 --Aurora I'm assuming you tried cycling through it a few times to make sure the addition wasn't happening? &nbsp;It will initially be 0 (the second parameter). Also, you understand that this will create a random offset once (say it rolls a 4, and gets 6 for the change) and apply it each time it comes up (0,6,12,18,24,...), right?