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

Refererence Error: n is not defined?

Hi all, I'm not sure if this is because of the DDOS attacks but my game's sandbox is failing with this error. Any ideas? Cheers
1691245821
timmaugh
Forum Champion
API Scripter
Does it give you a line number? If it does, you can (possibly) narrow it down to what script is the problem by using ScriptInfo -- if your sandbox will reboot and stabilize long enough for you to run a command. If, once you have ScriptInfo installed, you can get your sandbox to boot up to a stable session, run this command (substituting your line number in place of 1000): !scriptinfo 1000 The catch is that ScriptInfo uses an "opt-in" method of script registration, and some of the older scripts haven't implemented it, yet. If ScriptInfo can't identify the line as belonging to a particular script, it will at least be able to tell you it is x-number of lines before this one or y-number of lines after that one. That can help you narrow down which script is the problem. If it is a script (not a character sheet) and you can narrow it down this way, it might be easier for other people to test in their own games and to report their results.
Thanks for the assist but unfortunately it falls over immediately.
1691251051
Gauss
Forum Champion
Hi Garieth,  Your game isn't by chance a Marvel Multiverse game is it?
Gauss said: Hi Garieth,  Your game isn't by chance a Marvel Multiverse game is it? No, it's D&S 5e. I'm aware Marvel Multiverse is having API issues and thought 5e might be the same.
1691259575
timmaugh
Forum Champion
API Scripter
That is a strange one. What scripts do you have installed?
timmaugh said: That is a strange one. What scripts do you have installed?
1691267045
The Aaron
Roll20 Production Team
API Scripter
So, what you can do is start disabling scripts until the error goes away.  Once it has, you know the last one you disabled was the one causing the issue.  Let us know which one it ends up being, we should be able to fix it.  I'd suggest starting with the non-1-click scripts (no little planet next to them).
The Aaron said: So, what you can do is start disabling scripts until the error goes away.  Once it has, you know the last one you disabled was the one causing the issue.  Let us know which one it ends up being, we should be able to fix it.  I'd suggest starting with the non-1-click scripts (no little planet next to them). Ok, thanks. I'll get on to that tomorow. Cheers.
It appears to be this one: n('ready',()=>{   const getPageForPlayer = (playerid) => {     let player = getObj('player',playerid);     if(playerIsGM(playerid)){       return player.get('lastpage') || Campaign().get('playerpageid');     }     let psp = Campaign().get('playerspecificpages');     if(psp[playerid]){       return psp[playerid];     }     return Campaign().get('playerpageid');   };   on('chat:message',msg=>{     if('api'===msg.type && /^!gather-party(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){       const who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname');       const pid = getPageForPlayer(msg.playerid);       const page = getObj('page',pid);       Campaign().set({         playerspecificpages: false,         playerpageid: pid       });       sendChat('',`/w "${who}" <div>Players gathered to page: <code>${page.get('name')||"[Untitled]"}</code></div>`);     }   }); });
I am such an idiot, it seems that when I copy/pasted it into the game I lost the first character - an "o" and I was able to compare it to another of my games which is running fine. It seems I  can't be trusted with the simplist of tasks :-) Thanks for all the the help, I'm off to stand in the corner in shame.
1691334868
The Aaron
Roll20 Production Team
API Scripter
Glad you got it worked out!  I think you're in good company as probably everyone here has made that same mistake or similar.  I know I have! =D
That's kind of you to say but I still feel pretty stupid :-)