Alright so I think because you are telling your pet to move not hero. Your XY has a hard factor and you are not telling it to subtract (move down) from the y axis while maintaining your x axis. It is in a true loop so it will keep repeating the move down until the conditions are met ending the while loop.
Also you are not adding to the orders given, it is just left blank. You need to tell the console to add 1 for every loop complete. (check hint section for further details on how to do this in your language)
So by telling your hero to move down 10m and say attack, then adding 1 to your loop, the condition “ordersGiven < 5” will automatically break out of the loop when you hit 5 and continue into your next while true loop.
The first loop “orderGiven < 5” is what it will continue to loop until conditions are met, and then continue onto the next section of your code.
(I edited this comment a few times so that I gave info without full on giving the answer, I hope this helps!)
Also happy birthday=)