Hi guys, I've just implemented the patrol script from here: <a href="https://gist.github.com/anonymous/5980034" rel="nofollow">https://gist.github.com/anonymous/5980034</a> and using the object id obtained using this script: <a href="https://github.com/Roll20/roll20-api-scripts/blob/master/ObjectProperties/properties.js" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/master/ObjectProperties/properties.js</a> I substituted lines 7-11 in the patrol script with the following code: on("ready", function() { //Wait until the ready event fires so we know the campaign is completely loaded. //Get a reference to our patrolling token. log("Going Guard A..."); var patroltoken = findObjs({_id: "-K3IXTEVdm4N5IFg9XhK"}); Although I'm getting the error: evalmachine.<anonymous>:431 if(patroltoken.get("status_greenmarker") === false) return; ^
TypeError: Object [object Object] has no method 'get' at null.<anonymous> (evalmachine.:431:23) at wrapper [as _onTimeout] (timers.js:261:14) at Timer.listOnTimeout [as ontimeout] (timers.js:112:15) I'm not exactly new to JavaScript but I am pretty new to this api. Is there a library I need to include with my .js files? I've never actually been able to get .get to work on any objects before. Thoughts? EDIT: To confirm that it was actually detecting said token, I added log(patroltoken); and it displayed the correct details. (Also could someone please tell me how to put the above code in appropriate tags (i.e. code/quote) like I'm seeing in other posts? I tried [code][/code] and [quote][/quote] but that didn't work. First time posting on these forums lol)