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

ChangeTokenImage is crashing out

Hey Aaron...  I tried both the drop down version.. as well as the one on the github api library.. but i get errors. API Output Console Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info... For reference, the error message generated was: TypeError: Cannot read property 'substring' of undefined TypeError: Cannot read property 'substring' of undefined at TrackedObj._validateAttrs (/home/node/d20-api-server/api.js:787:21) at TrackedObj.set (/home/node/d20-api-server/api.js:858:18) at setImg (apiscript.js:76:11) at apiscript.js:178:17 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.(anonymous function) [as each] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1496:34) at handleInput (apiscript.js:154:4) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1510:12
1509568431
The Aaron
Pro
API Scripter
Hmm. I feel like that came up recently...
1509568533
The Aaron
Pro
API Scripter
The images you're trying it on are in your user library, right?
When I go to my library, it shows them there... Is there a way to verify?  
1509570881
The Aaron
Pro
API Scripter
Tracked down the issue to image urls with med instead of thumb or max or the like. Fixed the script to deal with it. Anyone with a similar issue can get an updated version here:&nbsp; <a href="https://github.com/shdwjk/roll20-api-scripts/blob/" rel="nofollow">https://github.com/shdwjk/roll20-api-scripts/blob/</a>... I pushed up a corrected version to the repo so you should have it there next week or so.
Thanks Aaron!&nbsp; For those who would like to see why I asked... Now that I have made 10 mini macros that are now token actions.. I can now just select a pic or pics and quickly click how many ticks or reset to 0.&nbsp; Great Stuff!
1509605028
Jakob
Sheet Author
API Scripter
Jamie, you may be interested in my Blades Companion script. It creates stress bars/trauma bars/clocks and keeps them up to date with the sheet.&nbsp;
1509643836

Edited 1509644421
Sure would! That would be great!&nbsp; I'll look for it in the library of github.. &nbsp; and let you know if I can't find it or have issues! Thanks! It was in the dropdown list.. Duh Jamie.. LOL!
Hey Jakob, just wondering...&nbsp; you didn't happen to make a scum & villiany companion while you were making the blades script?&nbsp; :D&nbsp; Happy Holidays!
1510821731
Jakob
Sheet Author
API Scripter
Jamie said: Hey Jakob, just wondering...&nbsp; you didn't happen to make a scum & villiany companion while you were making the blades script?&nbsp; :D&nbsp; Happy Holidays! Here you go
Jakob said: Jamie said: Hey Jakob, just wondering...&nbsp; you didn't happen to make a scum & villiany companion while you were making the blades script?&nbsp; :D&nbsp; Happy Holidays! Here you go WOW... thank you!&nbsp;