Help! Code error


#1

I used a code for Sarven Treasure one but doesn’t work again, nor will it tell me why…
Here it is:
loop {
var flag = this.findFlag();
var enemy = this.findNearest(this.findEnemies());
var item = this.findNearest(this.findItems());
if (flag){
this.moveXY(5, 19);
this.pickUpFlag(flag);
}
if (enemy){
if (this.isReady(“bash”)){
this.bash(enemy);
}
else {
this.attack(enemy);
}
}
}
if (item){
var pos=item.pos;
var x=pos.x;
var y=pos.y;
this.moveXY(x, y);
}
}


#2

Please format your code according to the FAQ in order to give us an easier job of helping you. Also provide more information. Does your hero move? Does he just stand there?