More code combat bugs

In code combat i just went in and there’s another bug sort of same thing as i posted last time i was moving at the start but i froze and i wasn’t moving like i should. Code combat also said i had a problem with enemy = hero.FindNearestenemy() the error card said TypeError : Statement execution limit reached and it gets stuck when I try to go into the level and i have to wait intul it loads again

Can you please send your whole code? Statement execution limit means you’ve run too many statements in a small time frame…

not sure how to post a screen shot so i will use copy and paste if that’s okay
here’s my code:
Use a while to loop until you have counted 10 attacks.

attacks = 0
while attacks < 10:
# Attack the nearest enemy!
enemy = hero.findNearestEnemy()
if enemy:
# Incrementing means to increase by 1.
# Increment the attacks variable.
attacks += 1

When you’re done, retreat to the ambush point.
hero.moveXY(79, 32)


Please use the code format button so I can see the indents :)

Also, there is no need to @ the person you’re talking to, and to be honest it’s kind of annoying

ok i won’t use @

it might be because your hero doesn’t see any enemies, so it keeps repeating findNearestEnemy()? what level is this?

there is enemy’s but i’m not attacking also it says that i have to defeat 10 ogre’s to and i only defeat 5

also the level is dust in the sarven desert