// Soldiers will slowly arrive, but the ogres will overwhelm them.
// A basic attack loop isn't going to be enough to keep you alive.
while(true) {
var flag = hero.findFlag();
var enemy = hero.findNearestEnemy();
if(flag) {
hero.say("Maybe I should do something with that flag?");
hero.moveXY(flag.pos.x, flag.pos.y);
hero.pickUpFlag(flag);
} else {
hero.say("I'm bored.");
var enemy = hero.findNearestEnemy();
hero.attack(enemy);
}
if (hero.isReady("cleave")) {
hero.cleave(enemy);
}
}
Projektuję strony www Lublin na Joomla i WordPress