[SOLVED] Endangered Burl (Bug?)


#1

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.


#2

The type here:

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


#3

:dizzy_face::hammer:


#4

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


#5

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


#6

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


#7

Much Abliged, good sir