[Adventurer] Airdrop

Can you send a screenshot then?

2 Likes

Please do post your code if you have a problem with it that you are asking about.

Please do not post completed solutions that someone else may just copy.

3 Likes

After Mr-Borges commentary here is my code. What am I doing wrong?

// Get all swords and protect the village.
function onSpawn(event) {
    while (true) {
        var item = hero.findNearestItem();
        //  The pet should fetch the item if it exists:
        if (item) {
            pet.fetch(item);
            pet.moveXY(22, 34);
        }
    }
}
// Assign onSpawn function for the pet's "spawn".
pet.on("spawn", onSpawn());
while (true) {
    // Guard the left passage: 
    var enemy = hero.findNearestEnemy();
    if (enemy) {
            hero.attack(enemy);
    }
    else{
        hero.moveXY(22, 34);
    }
}

Ok I have finally spot the mistake, it was the way I call the function on pet.on. As a newbie I can not post more than three responses. Thank you very much

1 Like

OK, that makes more sense of what I understood. Thanks

1 Like

‘Intro’ body:

Arm peasants and protect the village.

But in reality raven arm only your hero…

1 Like