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

New API Update 5/23: Direct access to roll engine, random numbers

There's a new API Update out today. The main highlight of this update is: Direct Access to the Roll Engine You now have direct access to the results of chat commands, including rolls. You do this by passing a function which will receive the results of commands sent to the sendChat function. So instead of sending the chat results to the players, it gets passed to you immediately in the API sandbox.&nbsp; <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> Random Numbers We've also added the randomInteger() utility function which will allow you to generate a random number using the same PRNG that Roll20 uses to power our dice rolls. In addition for convenience the API's Math.random() function is now replaced with one that uses our PRNG, so even if you use Math.random() we can now guarantee that you are getting statistically sound random results. <a href="https://wiki.roll20.net/API:Utility_Functions" rel="nofollow">https://wiki.roll20.net/API:Utility_Functions</a> More will be on the way soon!
1369323815
Alex L.
Pro
Sheet Author
Thanks Riley, looks good.
1369325101
Konrad J.
Pro
API Scripter
Wow, awesome. &nbsp;Now I will be getting even less sleep playing with this stuff tonight! :)