Restless dead- JS - please help solve

the soldiers don’t listen to my orders for some reason

// This level is supposed to be VERY hard! You may need a great strategy and or gear to complete it!

// Find and defeat the yeti then gather its essence for the ritual.
// You might want to gather the coins the yeti leaves behind, you'll need them to summon an army
// Stand at the summoning stone (red x) to begin summoning
// Now you just have to survive the undead hoard
hero.moveXY(42, 34);
while(true) {
    var enemy = hero.findNearestEnemy();
    if (enemy) {
        hero.attack(enemy);    
    }
    var item = hero.findNearestItem();
    if (item) {
        hero.move(item.pos);
    }
    else { 
        hero.moveXY(19, 40);
        hero.summon("soldier");
    }
    var friends = hero.findFriends();   
    var enemy = hero.findNearestEnemy();
    for( var i=0; i<friends.length; i++) {
        var friend = friends[i];
        if (enemy) {
            hero.command(friend, "attack", enemy);
            hero.attack(enemy);
        }
        
    }
    
}



Do you have the link to the level??

Also what error does it give??