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

[Help] Roll Dice from Sheetworker

I know there's a randomInteger(x) function, but I was wondering if there was a way to parse dice notation and resolve a roll from a sheetworker script? I considered just splitting the string on "d" and looping through randomInteger(arr[1]) a number of times equal to arr[0], but then things get complicated if they add in a "+2" at the end.  I could use regex to break the entire formula down, but before I go through all the work of reinventing the wheel, I want to make sure the feature doesn't already exist or that someone hasn't done this already.
1524844985
Jakob
Sheet Author
API Scripter
Nope. I think sheetworkers also do not have access to randomInteger, so they have to use Math.random() [which isn't very random].
Oh.  Well dang.