Remove the , enemy because you can’t target enemies with mana-blast; it is just centered around your hero. And change the hero.canCast("mana-blast") to hero.isReady("mana-blast").
I believe “haste” is working now. Hero.manablast() is also working. Now, my hero is killed by a scout right after I manablast them. I start with very little health. Do I need to buy more armor for Pender?
let redX = {x: 273, y: 37};
while (hero.pos.x != redX.x) {
hero.move(redX);
let enemy = hero.findNearestEnemy();
if (enemy && enemy.type !== "yeti") {
if (hero.isReady("mana-blast")) {
hero.manaBlast(enemy);
}
}
if (hero.canCast("haste", hero)) {
hero.cast("haste", hero);
}
}
I learned that I cannot use “shrink” and “haste” at the same time, so I got the book with “haste”. I also bought a robe that provided some more health. With these I was able to make it to the red X using “haste”, manablast(), and resetCoolDown().
If you aren’t going to buy other stuff for wizards you should probably just get one of the lower tier armors that should be enough to protect you from scouts.