// Prowadź wieśniaków i lekarza przez pole minowe.
while(true) {
var coin = hero.findNearestItem();
var healingThreshold = hero.maxHealth / 2;
// Check to see if you are critically injured.
if(hero.health < healingThreshold) {
// Idź w lewo 10m.
hero.moveXY(hero.pos.x - 10 , hero.pos.y);
// Poproś o uleczenie.
hero.say("Can I get a heal?");
// W przeciwnym wypadku, idź do następnej monety.
} else if (coin) {
hero.moveXY(coin.pos.x, coin.pos.y);
}
}
Projektuję strony www Lublin na Joomla i WordPress