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

Error Message Scrips disabled

Hello fellow People, I have only 3 Scripts from the library installed: 5e OGL, 5e Restsing in Style & 5E Battlemaster. Since i installed battlemaster i get the following Error: TypeError: Cannot read property 'results' of undefined TypeError: Cannot read property 'results' of undefined at Array.WeaponAttackRollCallback (apiscript.js:1711:46) at HandleInput (apiscript.js:1544:60) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1661: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) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) Can someone please help me with the problem? I dont have a clue
1598536231
The Aaron
Roll20 Production Team
API Scripter
What scripts do you have installed?
5th Edition OGL by Roll20 Companion G 5E Resting in Style G 5E BattleMaster
1598537699
The Aaron
Roll20 Production Team
API Scripter
The issue is in 5eBattleMaster.  Do you know what chat command you issued which resulted in the crash?  The script makes an assumption that there will be an inline roll as part of whatever message it's attempting to handle, but there wasn't one in this case.  Knowing what messaged triggered it to run will help the developer track down the issue and fix it. If this happens fairly rarely, it's safe to just restart the sandbox when it happens.
The script should be updated so that the assumption is replaced with input validation.  One should avoid making assumptions about user input whenever possible. At the lease, something as simple as catch all try-catch block that output usage info on error. 
1598539670
Victor B.
Pro
Sheet Author
API Scripter
Thank you for the lesson.  There isn't much in the way of standards for API development on Roll20 so you're at the whim of the developer.  Try reaching out to whomever is supporting it and if it hasn't been supported in quite a while, feel free to the make changes.  
You could try importing (instead of installing) the 5E Battlemaster script, replacing the '//log(' string to 'log(' and trying to reproduce the issue. This will produce the logs commented out by the API creator, which will let you know what part of the script is broken.