var points = [{x: 21, y: 8}, {x: 33, y: 8}, {x: 45, y: 8},
{x: 57, y: 8}, {x: 68, y: 8}, {x: 68, y: 18},
{x: 68, y: 28}, {x: 68, y: 38}, {x: 68, y: 48},
{x: 68, y: 58}, {x: 56, y: 58}, {x: 44, y: 58},
{x: 32, y: 58}, {x: 20, y: 58}, {x: 10, y: 60}];
var pointIndex = 0;
while (pointIndex < points.length) {
var point = points[pointIndex];
hero.moveXY(point.x, point.y);
var enemy = hero.findNearestEnemy();
var coin = hero.findNearestItem();
// Attack only if the enemy.team is "ogres"
// AND the enemy's health is less than 10
if(enemy.team == "ogres" && enemy.health < 10) {
hero.attack(enemy);
}
// Collect a coin if coin.value is less than 5
// AND its distance is less than 7
if(coin.value < 5 && coin.distance < 7) {
hero.moveXY(coin.pos.x, coin.pos.y);
}
// Attack only if the enemy.health is less than 10
// AND the enemy's type is "skeleton".
if(enemy.health < 10 && enemy.type == "skeleton") {
hero.attack(enemy);
}
pointIndex++;
}
Hero always pick up the farest coin so everybody can hear him.
This can work with a particular seed, but it’s not the right one.
/PS - off topic
. Have you used the console to create a session for “Bash ‘em all”?. I’ve maybe a solution, but a little effort is needed from you /
Actually I have not. I didn’t get it.
I do not know how to use console in that case. I only know how to open it and search for mistakes.
Yes i’m asking because I’m just stuck with it. And sometimes HINTS is not enough.
Please do not revive dead topics unless you need help on the same level, ok?
But it is ok to try and help people, but in some newer topics, do you understand?