Useful competitors mistake?


#1

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

Hi! Do you have sword?


#3

I added the sword, thank you!


#4

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