i am now using okar and this is my new code
var enemy = hero.findNearest(hero.findEnemies());
function banana() {
while (true) {
var enemy = hero.findNearestEnemy();
if (enemy) {
hero.attack(enemy);
hero.attack(enemy);
}
if (enemy) {
if (hero.isReady(“hurl”)) {
hero.hurl(enemy);
}
if (hero.isReady(“stomp”)) {
hero.stomp();
}
}
var flag = hero.findFlag(“green”);
if (flag) {
hero.pickUpFlag(flag);
}
}
}
while(true) {
banana()
hero.moveXY(92, 36);
}
i need to know where to put a movexy and wait command
I can destroy everything in the outer gate part but my hero will not attack the actul door
remove the first if (enemy)
and the next two hero.attack(enemy);
then write down something like…
if (enemy) {
elif (hero.isReady(“hurl”)) {
hero.hurl(enemy);
}
elif (hero.isReady(“stomp”)) {
hero.stomp();
}
else {
hero.attack(enemy);
}
}
sorry if I got some parts of the code wrong, because I don’t normally use javascript.