I need help plz, here is my code:
defeatedOgres = 0
while defeatedOgres < 6:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
defeatedOgres += 1
else:
hero.say(“Ogres!”)
hero.moveXY(53, 37)
while hero.gold < 30:
item = hero.findNearestItem()
if item and item.type == “coin”:
hero.moveXY(item.pos.x, item.pos.y)
Coin = hero.findItems(hero.findNearestItem())
Coin = hero.findnearestItem
hero.move(coin.pos)
hero.say(“I should gather coins!”)
hero.moveXY(76, 32)