Desert Combat: Help! What's wrong with my code?

ordersGiven = 0
enemy = self.findNearest(self.findEnemies())
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.findNearest(self.findEnemies())
hero.findEnemies()

self.moveXY(51, 32)
self.shield()
self.shield()

self.cleave(enemy)
self.attack(enemy)
self.cleave(enemy)
enemy = hero.findNearestEnemy()
hero.attack(enemy)
self.shield()

I don’t get what’s wrong with this code. It just stands there after we attack the gate

Cooldown for cleave is 10s - your hero just stand here for 10s.

Thanks @juraj_pechac . Will try to improve it