[Adventurer] Airdrop


#21

Can you send a screenshot then?


#22

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.


#24

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


#25

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


#26

‘Intro’ body:

Arm peasants and protect the village.

But in reality raven arm only your hero…