I am playing using Python, on a Windows 10 computer(sorry), using Chrome Navigator.
I am having an issue with the method findByType() when associated with a friend, I get an error, saying tmp38[tmp39] is not a function. Here is my code:
loop:
friends = self.findFriends()
for friend in friends:
yetis = friend.findByType(“yeti”)
yeti = friend.findNearest(yetis)
if yeti:
self.command(friend, “attack”, yeti)
It’s ok. Currently on line 6, your indention I think needs to be 1 space over. Also on line 4, You have yeti = friend.findNearestFriend(yetis). Is the (yetis) intentional. And I think on line 3 after for friend in friends and all the other lines need to be indented.
Friends have limited methods, usually only findNearestEnemy, findfindNearest and findEnemies. See the thang editor for details (e.g. archer and go to the programming.HasAPI section).
But luckily, you can combine them with your methods, e.g.:
enemies = friend.findEnemies()
yeti = self.findByType("yeti")[0] # select the first (and only) yeti from the list
But to be honest, you don’t really need to do anything with that yeti on this level…
Thanks Everyone, especially Ant, I didn’t know where to look, now I understand what was wrong,.
Thanks for the hint about the Yeti, I had to understand why it wasn’t working so I targeted the first enemy I saw.