// Accumulate 300 gold and escape from the dungeon.
function onSpawn(event) {
// Send the pet to walk around the dungeon:
pet.moveXY(21, 57);
pet.moveXY(71, 57);
pet.moveXY(71, 11);
pet.moveXY(20, 11);
// Don't forget to return it to the hero:
pet.moveXY(21, 34);
}
pet.on("spawn", onSpawn);
while(true) {
// Guard peasants:
var enemy = hero.findNearestEnemy();
if (enemy) {
hero.attack(enemy);
hero.moveXY(19, 34);
}
// When you have 300+ gold move to the red mark:
if (hero.gold > 300) {
hero.moveXY(50, 34);
}
}
Projektuję strony www Lublin na Joomla i WordPress