my code
while True:
enemy = hero.findNearestEnemy()
if(enemy):
if hero.isReady("cleave"):
hero.cleave(enemy)
elif hero.canElectrocute(enemy):
hero.electrocute(enemy)
else:
hero.attack(hero.findNearestEnemy()
item = hero.findNearestItem()
elif(item):
hero.moveXY(item.pos.X, item.pos.Y)
it shows
fix you code
cannot read property ‘start’ of undefined