# Find items and move to their position. while True: item = hero.findNearestItem() if item: hero.moveXY(item.pos.x, item.pos.y)