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

Critical Script Troubleshooting

1661647905

Edited 1661648189
Hi all, I'm about to start my campaign next week. I'm running 5e with a number of API scripts, more than I have used in the past. Now I'm running into a problem and am not sure how to troubleshoot. I'm using this critical script . I installed it a while back and have successfully run commands with it to set up criticals for several characters. However, today I tried to do the same for some newer characters, and the script won't run.  I've tried restarting the sandbox, and all of the scripts load without issue. Sometimes if I go to the API screen though, it just says "Roll20 Environment: Web". Other times it has all of the information about what scripts are running. It's inconsistent. But if I open the game and run a very basic command like this: !critbot --settings I don't get anything at all. I've tried restarting numerous times, and at times I can get that command to work, but if I run any commands to assign criticals, they don't do anything. In fact, it seems like when it's in this state, none of the APIs work. So, I'm not very technical. How would you recommend I troubleshoot? 
OK, I've figured out something more. The API is giving me this error when I execute this command: !critbot --apply --sel --attacks Here is the error: TypeError: op.content.replace is not a function TypeError: op.content.replace is not a function at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:369:29) at sendChat (/home/node/d20-api-server/api.js:1897:16) at clog (apiscript.js:8731:42) at getTokenIds (apiscript.js:9184:9) at customCrit (apiscript.js:8749:26) at handleInput (apiscript.js:9086:17) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 Any ideas?
1661660221

Edited 1661665217
Oosh
Sheet Author
API Scripter
I'll have a look... are all the other scripts working ok? Menus getting sent to chat, and so forth? I can't see anything obvious, unless somehow the state got messed up. I've pushed a new version , give that a go and see if it's any different. If !critbot --settings is not firing reliably, it might be easier if I jump into your game to have a look, if you're ok with co-GMing me temporarily. I can't really see any reason why that command wouldn't be working... and failing randomly is very odd.
Thanks Oosh. Let me play around a bit more. The inconsistency is bothering me, almost like something was wonky with the APIs overall. I'll give the new version a try. 
OK, I tried the new version and got the same result. I'd be happy to let you play around in my game. 
And yes, until the error is thrown (because I run the critbot command), everything seems to be working as expected. I messaged you an invite link. Let me know when you accept and I'll promote you to GM. I'm sure there's some chance it's conflicting with something else. I've never run this many APIs at once before. Thank you!