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] API shutdown when setting Variable

1461313953

Edited 1461708059
Hey, I'm writing a script to call a character ability with a number moveNo and depending on an attribute DType assign a different ability. However when I call my script when it goes to set the variable it is giving me a: Possible infinite loop detected, shutting down. It works for one of my cases perfectly fine, however for the other two cases it runs into the above error. The code below is minimised to one of the cases that gives me an error.     move = function(moveNo, character){         var checkMoveType = getAttrByName(character.id, "Move"+ moveNo + "_DType");         var CharName = character.get("name");         var text = "false";         switch (checkMoveType){             case 'Physical':                 log("phys1");                 text = "%{"+CharName+"|Move"+moveNo+"AtkPhys}";                 log("phys2");                 break;             default:                 log("Error");                 break;         }         if (text !== "false") {             var who = 'character|' + character.id;             sendChat(who,text);         }     }, as far as the two log events, they where for testing, and in the API Output Console I'm getting just the first log message phys1 The ability that is getting called is about 738 characters long. I'm not experienced with javascript whatsoever. I'm also running this script on the Dev server if it matters. Resolved (Thanks to The Aaron) The issue was when the ability was being used it was using an attribute that didn't exist in the attributes of the character.
1461330741
The Aaron
Pro
API Scripter
There isn't enough here to tell me what is going on.  When does that error show up?  I've seen it after long periods of inactivity on the dev server, but not while doing anything in game, is your experience similar?
1461363634

Edited 1461365886
No, It occurs when I attempt to do the command that calls the function. From what I can tell it reaches text = "%{"+CharName+"|Move"+moveNo+"AtkPhys}"; Then it gives the error without going any further. However I moved the script off the dev server to test it and it's just giving me a blank error rather than the Possible infinite loop error. I sent you the link to simplify things because this is meant for the PTU Sheet and it works for one of three cases.
1461380974
The Aaron
Pro
API Scripter
Ok, I'll try to take a look tomorrow.