oh I get it but its just starting labeling the coin, "coin, gem, item, bottle " though
Looking at your code, delete lines 24 and 25. You don’t want to do anything if there’s a bottle, just wait for it to disappear. Also delete line 16.
Lines 10, 17, 18 and 19 are all labelling the nearestItem as (respectively) item, gem, coin and bottle. You only need the first one of these, delete the others if you want tidier code.
wait what do I do in if item.type == "coin" or item.type == "gem":
Then?
The line you had in before inside the if statement was good. Put this back in:
hero.moveXY(itemX, itemY)
but then the hero attack the burl and the burl kills the hero
Wow, this is complicated
I think it might be lines 8 and 9 that are the problem now. Try deleting them?
Thanks so much jka2706! I finished it!
Well done .
sorry it worked, but when I press submit it going to attack the enemy, but there was a bottle there and it ran into the bottle. Then it died.
oh nevermind I put my ring on hat commands “wait” so i put it and now it works. Thanks though
thanks for the like jka2706!
while True:
enemy = hero.findNearestEnemy()
if enemy.type == "munchkin" or enemy.type == "thrower":
hero.attack(enemy)
item = hero.findNearestItem()
# Check the item type to make sure the hero doesn't pick up poison!
# If the item's type is "gem" or "coin":
if "item gem or coin":
# Then move and pick it up:
what do I do?
while True:
enemy = hero.findNearestEnemy()
if enemy.type == "munchkin" or enemy.type == "thrower":
hero.attack(enemy)
item = hero.findNearestItem()
# Check the item type to make sure the hero doesn't pick up poison!
# If the item's type is "gem" or "coin":
if "item gem or coin":
itemy = hero.distanceTo(item)
itemx = hero.distanceTo(item)
# Then move and pick it up:
hero.moveXY(itemx, itemy)
```I'm heavly stuck help I keep dying to pioson
This is not how to write if the item type is a gem or coin
you didn’t pick the items up either
Read these two carefully.
Lydia
thank you, that is going to help alot
I’m still stuck, it doesn’t work, I keep dying to a poison vile
what is your code
20 chars