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

[Help] Turn Tracker has started to crash the API

1487904042

Edited 1487904131
edit: Found the url to the script! - &nbsp; <a href="https://app.roll20.net/forum/post/3963829/script-u" rel="nofollow">https://app.roll20.net/forum/post/3963829/script-u</a>... Heya, so I've been using Turn Tracker--I can't seem to find the url to the script...the one with the fairly recent update that pulls the map over to the token at the top of the initiative order. I'll post it when I manage to find it. Anyway, it was working perfectly fine until about an hour ago. Every time the round counter hits the top of the initiative order, it immediately crashes the API and spits out the following error message: For reference, the error message generated was: Error: Firebase.update failed: First argument contains NaN in property 'bar2_value' Error: Firebase.update failed: First argument contains NaN in property 'bar2_value' at Error (native) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at H.J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:766:27) at later [as _onTimeout] (/home/node/d20-api-server/node_modules/underscore/underscore.js:828:25) at Timer.listOnTimeout (timers.js:92:15) I haven't changed any of my scripts in a little while so I'm not entirely sure what went wrong with it. So yeah, whenever someone can help me out, I'd be thankful. Thanks! :)&nbsp;
1487905620
The Aaron
Pro
API Scripter
Hmm.. try changing the bar2 value to 0, or deleting the orange symbol token. &nbsp;If that doesn't work, drop me an invite and I'll jump in and see what I can do.
1487918566

Edited 1487920941
It worked for about 5 minutes. Then it broke again for some reason. You know, I already count rounds/announce turns/have a graphical marker already set up with other macros/scripts, all I really want is the ping pulling feature so it pulls the map over to the token at the top of the count. Would it be at all possible to just tear that part out for me to make things simple? The rest of it just over-complicates things :/
1487945136
The Aaron
Pro
API Scripter
See if this works for you: on('ready',function(){ &nbsp; &nbsp; "use strict"; &nbsp; &nbsp; let fixedSendPing = (function(){ &nbsp; &nbsp; &nbsp; &nbsp; var last={}; &nbsp; &nbsp; &nbsp; &nbsp; return function(left,top,pageid,playerid,pull){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( last.left &nbsp; === left &nbsp; && &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last.top &nbsp; &nbsp;=== top &nbsp; &nbsp;&& &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last.pageid === pageid ) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendPing(-100,-100,pageid,null,false); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendPing(left,top,pageid,playerid,pull); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last.left=left; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last.top=top; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last.pageid=pageid; &nbsp; &nbsp; &nbsp; &nbsp; }; &nbsp; &nbsp; }()); &nbsp; &nbsp; on('change:campaign:turnorder',function(c){ &nbsp; &nbsp; &nbsp; &nbsp; let firstTurn=_.first(JSON.parse(Campaign().get('turnorder'))||[]); &nbsp; &nbsp; &nbsp; &nbsp; if(firstTurn && firstTurn.id !== -1){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let tok=getObj('graphic',firstTurn.id); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(tok){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fixedSendPing(Tok.get('left'),Tok.get('top'),Tok.get('pageid'),null,true); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }); }); I didn't test it yet, but it should give you the pulling for the top of the turn order each time it changes.
It's currently crashing the API--Here's what I'm getting: For reference, the error message generated was: ReferenceError: Tok is not defined ReferenceError: Tok is not defined at apiscript.js:13178:31 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:34), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:34), &lt;anonymous&gt;:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:901:14) at updateLocalCache (/home/node/d20-api-server/api.js:1194:18) at /home/node/d20-api-server/api.js:1484:7 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 Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) Thanks for the help :)
1488072180

Edited 1488072248
PaprikaCC
Pro
API Scripter
You just need to change line 24 in The Aaron's snippet to: fixedSendPing(tok.get('left'),tok.get('top'),tok.get('pageid'),null,true); There was an accidental capital letter.
OF COURSE it had to be something as a capitalization mistake. Haha thanks a bunch :D
1488080302
The Aaron
Pro
API Scripter
What Paprika said! &nbsp;:). I wrote that while on a conference call at work so didn't get a chance to test it. Let me know if it's still failing and I'll test it tomorrow and get it sorted out right.&nbsp;
Nope, seems to be working exactly how it should after quickly scrolling through a few rounds, moving tokens, changing maps, etc. Thanks you guys :)&nbsp;