[SOLVED] Endangered Burl (Bug?)

I have reviewed the other topics similar to this and have found nothing similar to the the problem I have, I will post my code but I do not think that is the problem, though I could be wrong…

while(true) {
    var enemy = hero.findNearestEnemy();
    if (enemy.type == "burl") {
        hero.say("I'm not attacking that Burl!");
    }
    if (enemy.type == "munchkin") {
        hero.attack(enemy);
    }
    if (enemy.type == "thrower") {
        hero.attack(enemy);
    }
    if (enemy.type == "orge") {
        hero.moveXY(22, 47);
}
}

The first part of the code executes but when it gets to this code

    if (enemy.type == "orge") {
        hero.moveXY(22, 47);
}

The hero just stands there, here is a screenshot

I believe that this is a bug but it could be human error on my part so I would like confirmation of my theory. Help would be appreciated.

The type here:

is meant to be type == "ogre", that’s the only problem, it’s just a typ0. :grin:
:lion:

:dizzy_face::hammer:

1 Like

When I type this

if (enemy.type == "orge", {
    hero.moveXY(22, 44);

}
I get this error
Unmatched ´)´
When I type this

if (enemy.type == "orge",) {
    hero.moveXY(22, 44);

}
I get this
Unexpected ´)´

Could you please clairafy

i’m not sure what you mean. They’re both the same and both misspelled.

I am not sure what I mean either, I found my mistake…
A testament of why I don´t enter spelling contest

2 Likes

Much Abliged, good sir

1 Like