I just seem to get stuck on the easier things…
var decoysBuilt = 0;
while (true) {
var coin = hero.findNearestItem();
if (coin) {
hero.moveXY(hero.pos.x, hero.pos.y);
}
if (hero.gold >= 25) {
// buildXY a "decoy"
hero.buildXY("decoy", hero.pos.x, hero.pos.y);
decoysBuilt += 1;
}
if (decoysBuilt == 4) {
break;
}
}
hero.say("Done building decoys!");
hero.moveXY(14, 36);
hero.say(decoysBuilt);