This is what I’ve got to so far 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.type == “gem” or “coin”:
hero.moveXY(item.pos.x, item.pos.y)