varself,routine;self=this;routine={enemies: false,targetNearby: function(){routine.enemies=self.findEnemies();for(vari=0;i<=routine.enemies.length;++i){varenemy=routine.enemies[i];if(enemy){vardistance=self.distanceTo(enemy);if(distance<=35){returntrue;}else{returnfalse;}}else{returnfalse;}}returnfalse;}};while(routine.targetNearby()){self.say(routine.targetNearby());}This code seems to confuse it. routine.targetNearby() should return a simple true or false if there is a target nearby that satisfies the distance requirement. It's returning [Object Object] as per the heros say. My best guess is that it's actually returning the function object itself instead of executing the function. but thats just a guess.
This code seems to confuse it. routine.targetNearby() should return a simple true or false if there is a target nearby that satisfies the distance requirement. It's returning [Object Object] as per the heros say. My best guess is that it's actually returning the function object itself instead of executing the function. but thats just a guess.