enemy – You only search for an enemy once.
You should search for enemies continuously.
(No enemy found in the beginning means the lines if enemy and ready: and elif enemy: always evaluate to False)

flag – In the while True: loop
The line, elif flag:
Maybe you meant elif not flag:? (and you also need to move to the flag and pick it up)
(No flag found in the beginning means that elif flag: will always evaluate to False)

ready – You never update this variable inside the while True: loop.
Instead of if enemy and ready:, you can use if enemy and hero.isReady("cleave"):
Then, you won’t need the ready variable anymore.
(In your code right now, ready will always be True)