My code stops halfway through. Could anyone give me a hint what could be the issue here?
while True:
flag = hero.findFlag()
enemy = hero.findNearestEnemy()
item = hero.findNearestItem()
if flag:
hero.moveXY(flag.pos.x, flag.pos.y)
hero.pickUpFlag(flag)
elif enemy:
if self.isReady("cleave"):
hero.cleave(enemy)
else:
hero.attack(enemy)
elif item:
hero.moveXY(item.pos.x, item.pos.y)