Clash of Clones help needed [Solved]

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

1 Like

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!

Please format your code correctly by clicking on the </> button,
Also please show your gear.

nvm, i figured it out

3 Likes

ok then, please mark any of the replies as a solution so it gets locked and does not persist

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.