Hi guys, I´m really freaking out trying to get why I get an error in this level:
# If you win, the next time you play will be more difficult and more rewarding! # If you lose, you must wait a day before submitting again. while True: enemies = hero.findEnemies() friends = hero.findFriends() if hero.gold >= 20: hero.summon("soldier") hero.move(hero.findNearestItem().pos) for friend in friends: target = friend.findNearestEnemy() hero.command(friend, "attack", target) if pet.isReady("charm"): ogre = pet.findNearestEnemy() if ogre and ogre.health > 100: pet.charm(ogre)
if I comment the part about pet.charm(ogre) it works smoothly, but without comments I get argument error in the line 14, hero.command(friend, “attack”, target)
I don´t see how they are connected, both blocks of code work if they are alone.