Back to back level - unable to pass

Hello,

I am having problems with Back to Back.I am new to coding. I am coding in python and keep getting error message “Line 6: tmp11[tmp12] is not a function” I don’t understand what the message means.

Here is the code that I have written so far.

loop:
enemy = self.findNearestEnemy()
if enemy:
self.attack(enemy)
self.attack(enemy)
else:
self.moveXY(40, 34)

Any assistance is greatly appreciated.

Thank you in advance for your time and feedback.

Welcome to the forums MzReneeRN please read the FAQ on how to format your code properly.

I cannot see any error assuming that your indentation is proper

To receive further help please do as Feinty suggested.

Also: Did you post your complete code? Please indicate which one is Line 6. At the moment line 6 seems to be else:, which is indeed not a function, but the error for a mismatched else looks different. You can simple put a comment where the error points too. Also tell us which parts of the line are red and which ones are green (if any).

It sounds like you might not have equipped a weapon, or maybe you haven’t equipped the leather boots. Seems like that might be what is causing this error message (which is terrible right now, sorry!).

I think this is line 6 and there is no such function as findNearestEnemy() for self at least I don’t have it :stuck_out_tongue: some of units do, “soldier” as I recall from one of the missions

It’s from early glasses. The first glasses have findNearestEnemy, later you get findNearest and findEnemies.


@MzReneeRN Which glasses do you have equipped and do they have the findNearestEnemy-method?