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 while using Slide Token: problem with Slide Token or problem with API?

Hi all, Just installed Slide Token from the API repository and whenever I try to use the !movetok command, my scripts all stop and I get the following error in the red box above the API Output Console: TypeError: Cannot read property 'token' of undefined at executeMoveQueue (apiscript.js:2217:44) at Object.bshields.translateToken.commands.movetok (apiscript.js:2092:17) at handleInput (apiscript.js:2357:38) at eval (eval at (/home/node/d20-api-server/api.js:105:34), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:105:34), :70:8) at /home/node/d20-api-server/api.js:1163: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) I think this means that it is breaking the Roll20 API and I can't fix it, but I'm not sure.
1460241557
Lithl
Pro
Sheet Author
API Scripter
The script ought to compensate for it, but did you have one or more tokens selected when you used the command?
Just one.  If you try to do it without any selected it prints a "hey dummy" type message to the chat log.
1460257083
Lithl
Pro
Sheet Author
API Scripter
What arguments did you pass to the !movetok command? I was able to replicate the error by either supplying no arguments, or supplying no arguments that had a valid direction component. I'll commit fixes to that shortly, but in the mean-time you can patch your own script by making the following changes: (- at the start means delete a line, + means add a line. Lines are numbered below for you) 41 - tokens = []; + tokens = [], abort = false; 59 + if (args.length === 0) { sendChat('System', '/w "' + caller + '" No directions supplied.'); return; } 80 + abort = true; 123 + if (abort) return; Alternatively, so long as you pass at least one argument to !movetok that has a valid direction component (and supplying no direction component at all is valid), you should be able to avoid that error as well.
1460259593

Edited 1460259611
Lithl
Pro
Sheet Author
API Scripter
PR #260 should fix this bug, and it adds a useroption to select the mode similar to the !mode command. Hopefully I did that part right. =P
Yeah, I'm pretty sure I was just too dumb to be passing the arguments correctly.  Thanks!