The first section of code that gives the commands works, but it doesn’t get to the last soldier since you say attack before moving. If you move the
self.say("Attack!") after the
self.moveXY() you will also get the last soldier.
The ordersGiven is to make sure you don’t get stuck in the first loop. You don’t need to use that any more after that.
In this level, the “palisade” is an enemy and can be found with
hero.findNearestEnemy() so all you really need to do at this point is loop through finding the enemy and attacking. You don’t have to separate them out.
If you want to identify them by type you need to use the
enemy.type == "palisade" or `enemy.type == “ogre”. If you click on the enemy, you can see what their type is at the bottom and in this level, he is actually a “brawler”.
More detailed look if the explanation doesn't make sense
enemy = hero.findNearestEnemy()
if enemy and enemy.type == "brawler":
elif enemy and enemy.type == "palisade":