Useful competitors mistake?

Hi,

YOUR written code hero.attack(enemy) - gives me a mistake. I added my own code and it doesn’t work.
The hero doesn’t attack enemies. Because hero.attack(enemy) is not functioning.

while True:
enemy = hero.findNearestEnemy()
if enemy:
if enemy.type != (“peon”):
hero.attack(enemy)
item = hero.findNearestItem()
if item:
# Gather the item only if the type is NOT equal to “poison”.
if item.type == (“poison”):
hero.pick(item)

    pass
2 Likes

Hi! Do you have sword?

3 Likes

I added the sword, thank you!

2 Likes

You are welcome!) When game says that something doesn’t work, often it means that you didn’t equip thing needed for this.

2 Likes