I have done everything but I keep running into poison
I HAVE DONE EVERYTHING. I KEEP RUNNING INTO POISON. I even tried picking a random spot in case of poison item. It works but eventually it runs into the corner poison
I tried picking many different random spot in case of poison. None worked
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 poiso
# If the item's type is "gem" or "coin":
if item == "gem" or "coin":
pos = item.pos
itemx = pos.x# Then move and pick it up
itemy = pos.y
hero.moveXY(itemx, itemy)
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 poiso
# If the item's type is "gem" or "coin":
if item == "gem" or "coin":
pos = item.pos
itemx = pos.x# Then move and pick it up
itemy = pos.y
hero.moveXY(itemx, itemy)
in this section
change item to item.type == gem or item.type == coin.
change pos = item.pos to itemPosition=item.pos
change itemx and y to have x and y capitalized
instead of the = pos.x and y change it to itemPosition.x and itemPosition.y
and then again on the last last line change hero.move to (item to capital x and y )
I think you should get it see if that works.