I don’t know what’s wrong with it. Help.
ordersGiven = 0
enemy = self.findNearestEnemy()
while ordersGiven < 5:
self.say("Attack!")
x = self.pos.x
y = self.pos.y - 10
self.moveXY(x, y)
ordersGiven = ordersGiven + 1
while ordersGiven > 5:
enemy = self.findNearestEnemy()
if enemy:
self.attack(enemy)
else:
self.shield()