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

Scripts disabled due to an error?

Hello all - hoping to get some help determining the root cause for the following script error I'm seeing.  I am using a number of scripts from the library; but, can't seem to trace or find why this error is now coming up.  I noticed this last night after the map changer macro wasn't working for my players or myself.  Any assistance is greatly appreciated.   Here is the error: TypeError: Cannot read property 'forEach' of undefined at getAttackInfo (apiscript.js:8318:16) at apiscript.js:8176:5 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)
1600963125
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
getAttackInfo  indicates that it probably isn't the map changer macro. Look for a script that would likely use a function named like that.
So, in the good ol' fashion of MS troubleshooting I disabled and reenabled the PowerCard script...and it's not throwing an error now? *fingers crossed*  Maybe just some type of glitch...nothing like an intermittent error to make things interesting.  Appreciate the response Keith - thank you.
1600966952
GiGs
Pro
Sheet Author
API Scripter
It's not likely to be a glitch. If it's triggered by the Power Card scripts, you should try to check the sandbox every time you run a powercard roll, to see its still running. Basically keep an eye on your power card rolls, because its possible one of them has improper syntax and is causing the crash.
You may also want to install The Aaron's 'APIHeartbeat' Script, which gives you a visual indication if your API sandbox has stopped due to an error.&nbsp; <a href="https://app.roll20.net/forum/post/1567329/script-apiheartbeat-a-visual-cue-that-the-api-is-running/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/1567329/script-apiheartbeat-a-visual-cue-that-the-api-is-running/?pagenum=1</a> Basically, if any script you are running throws an error, Roll20 will shut down all of your scripts, so you have to open up the API Script page for the game and restart it.&nbsp; I keep the API Script page open in another tab so I can just tab over really quickly when something happens and restart.&nbsp; My players don't even usually realize anything has happened.
1600985482
Kurt J.
Pro
API Scripter
PowerCards itself doesn't contains a getAttackInfo function, but PCMacroHelper does. However, it is only called if you run !pcm. Looking at the code, I think the issue might be running !pcm with nothing selected, as it looks like there is no error checking for that condition. I'll rectify that in the next update. Thanks for pointing out the issue.