Computer Science 3, level 53

Oh so I dont know ewhat to do here:

// Collect 9 mushrooms.

// This function makes the pet fetch potions for you.
function onSpawn(event) {
    while(true) {
        // Pets can find the nearest item by its type.
        var potion = pet.findNearestByType("potion");
        // Make the pet fetch the potion if it exists:
        if (potion){
            pet.fetch("potion");
        }
    }
    
}
pet.on("spawn", onSpawn);

// Mushrooms are toxic, don't collect them too quickly.
while(true) {
    var someItem = hero.findNearestItem();
    if (someItem && hero.health > hero.maxHealth / 3) {
        // Collect the someItem:
        **This is where I need help**
    }
}

Do hero.moveXY(someItem.pos.x,someItem.pos.y)

Thanks i tried it and it worked