When i use my code it keeps on telling me incomplete and my hero keeps dying. can anybody help me figure out how to fix this error.
hero.moveXY(80, 80)
enemy = hero.findNearestEnemy()
hero.cleave(enemy)
enemy = hero.findNearestEnemy()
hero.cast(“chain-lightning”, enemy)
while True:
enemy = hero.findNearestEnemy()
if hero.isReady(“cleave”) and enemy.type != “sand-yak”:
hero.cleave(enemy)
if hero.isReady(“chain-lightning”) and enemy.type != “sand-yak”:
hero.cast(“chain-lightning”, enemy)
if enemy.type != “sand-yak”:
hero.attack(enemy)
if hero.health < 250:
hero.moveXY(51, 66)
This is my code and i am using Python