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

Syntax error: Unexpected token Var

This has popped up in the last week (or so).  I'm using Initiative Tracker and Flight api's.  They worked fine (in one campaign) as of two weeks ago.  Within the last week the Unexpected token Var has popped up every time I select a token in either of the campaigns I use these in.  I tried removing one or the other or both.  Apparently neither one works.  I recopied the script code and 're-installed'.  Still no luck. I'm guessing something in the recent api update might have caused a change in how the script needed to be written for selecting tokens.  I'll probably have to wait for the scriptors to figure out what's wrong and correct it. To clarify the issue: Flight and Initiative Tracker are the scripts I use.  They load and 'install' fine. When in the game, if I select a token, my api sandbox shuts down and gives the Syntax error: Unexpected token var. Restarting, reloading, re-installing all produce the same results. These tokens are not always the "default" token from the character sheet, it happens with the character image as well.  Also, in one campaign I use the basic pf character sheet, the other uses the tabbed version (not sure if that would matter.) Any suggestions? 
1472335569
The Aaron
Pro
API Scripter
This happens as soon as you select a token?  You aren't doing anything else but selecting it?
It seems that way.  But now that I think of it, it might not be.  I select the token and try the !fly command.  Nothing happens so I pop over to the other tab and see the error.  I restart the sand-box and then get the error any time I select the token.  Now it seems to happen when I join the game in a new tab.  Or even just let the sandbox sit.  Sounds like I've got a rogue feline in my api sand-box.
1472336689
Lithl
Pro
Sheet Author
API Scripter
I pushed an update to Flight a little while ago designed to help let someone import the script and extend it. I thought I had it working correctly, but I'm fallible. Try using the previous version of Flight instead of the most recent and see if the problem disappears. I'll look at the script when I get back to my computer.
It is specific to those 2 scripts (which are copy/pasted to the game).  When I disable them things work fine (including the It's a Trap api in my current game.)
1472336943
Lithl
Pro
Sheet Author
API Scripter
Hmm, if you're not using one-click install, then a new version push wouldn't introduce a problem for you...
Brian, Thanks for the suggestion, I had it working fine (including the mods I made) as of a week or 2 ago.  This error seems to be pretty recent (like around the latest api change).  There may be some clash between scripts that call for the same token/status markers?  But for some reason they don't seem to want to work at all now.  (Time to clear the cache maybe.)
1472338465
The Aaron
Pro
API Scripter
Cache won't have anything to do with it. API scripts run on a server in the cloud. If you disable flight, the other still crashes with the same error?
I've been doing more testing.  Now it seems to only be the tracker script.  Flight works fine.  At least in Firefox.  It wasn't working in chrome earlier, but I'll be testing that next. Edit: OK I think I may be a bit embarrassed here.  It looks like I simply named the script wrong and there was a clash?  I called it tracker and had problems, called it Initiative Tracker, still problems.  Take the space out and it seems to work now (at least in chrome.  Checking firefox too because I sometimes use both or switch.) If this really was my error, I apologize for wasting a lot of your time, and thanks for all the help. Keep an eye out though, I'll probably be back with another coding puzzle. Well now I'm even more silly.  I forgot to enable the script.  No wonder it seemed to be working.
It is just the Initiative Tracker script that gives an error now. (Just to clarify from my weird edits and rambling).
1472340489
The Aaron
Pro
API Scripter
Cool. One down...  :) So, if you disable everything except it, do you still get a crash?  What do you do that causes the crash?
Apparently having the script active causes the error.  I'm still running the various support scripts (token collision, vector math, etc) when that happens.  I'll try without all the support apis next. 
OK looks like something in the split args support api clashes with something in the initiative tracker api.  The tracker doesn't cause the error if I turn off the split args api. It's strange that I had them both working for a bit and suddenly there is conflict.  Maybe I missed something when I had them working.
1472346133
Lithl
Pro
Sheet Author
API Scripter
splitArgs has not been changed in a long time.
Yeah.  Which is weird.  there was a point where I couldn't get Flight to work (possibly because I didn't have the split args loaded) on one campaign.  Now that I want to use it in a different campaign, suddenly the tracker api causes 'crashes'.  I swear I had both working for a bit, but that may have been just me and my lousy memory.  At any rate, I've found that the tracker isn't as useful for my Spelljammer as the Flight will be.  I'll continue to use whichever is more handy.