Ok, so this is my code,
// Use your new skill to choose what to do: hero.now()
while (true) {
if (enemy) {
var enemy = this.hero.findNearestEnemy();
}
// If it's the first 10 seconds, fight.
if (this.now() < 10 & enemy != "palisade") {
if (enemy) {
this.attack(enemy);
this.attack(enemy);
}
// Else, if it's the first 30 seconds, collect coins.
} else if (this.now() < 35) {
if (item) {
var item = this.hero.findNearestItem();
this.hero.moveXY(item.pos.x, item.pos.y);
if (gold >= 22) {
this.hero.say("soldier");
}
}
if (item) {
var itemX = item.x;
var itemY = item.y;
} // After 30 seconds, join the raid!
} else {
if (enemy) {
var enemyU = this.findNearest(this.findEnemies());
this.hero.attack(enemyU);
this.hero.shield();
}
}
}
But how do I keep Nadia of the leaf from attacking the palidise if I am Anaya?