Restless Dead (Javascript, Anya)

My soldiers and I are losing the battle. Not sure what else to do, other that try a different character.
Is there a spell, weapon, or armor I should add for Anya to work?

hero.setFlowerColor("blue");
let redX = {
    x: 19,
    y: 40
};
hero.moveXY(56, 15);
while (hero.pos.x != redX.x) {
    let yeti = hero.findNearestEnemy();
    if (yeti) {
        hero.attack(yeti);
    }
    let item = hero.findNearestItem();
    if (item) {
        hero.moveXY(item.pos.x, item.pos.y);
    }
    hero.move(redX);
}
while (true) {
    if (hero.gold >= hero.costOf("soldier")) {
        hero.summon("soldier");
    }
    let enemy = hero.findNearestEnemy();
    if (enemy) {
        let soldiers = hero.findFriends();
        for (let soldier of soldiers) {
            hero.command(soldier, "attack", enemy);
        }
        if (hero.canCast("drain-life", enemy)) {
            hero.cast("drain-life", enemy);
        } else {
            if (hero.canCast("chain-lightning", enemy)) {
                hero.cast("chain-lightning", enemy);
            } else {
                hero.attack(enemy);
            }
        }
    }
}

Can you post a picture of your gear?

I bought a new shield and sword, then ran the same code and it worked!! :grinning: :+1:

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.