Help with countiniuos alchemy in java script


#1

my hero seems have a problem with this code…

loop { var item = hero.findNearest(hero.findItems()); if (!item) { hero.say ("give me a drink!"); } else { if (item.type != "posion") { hero.moveXY(44, 36); hero.moveXY(34, 47); } } }


#2

Hello, the level is teaching continue statements, but I don’t see any continue statements in your code?


#3

I am attempting to solve the level as with the continue I couldn’t.


#4

Are you experiencing an infinite loop problem? If so, it is due to a bug in the game, see this thread.


#5

no, my hero is just attempting to drink anything and sometimes doesn’t get there in time


#6

Oh I see, I should’ve paid more attention to your code. The problem is that you have a typo: “posion” should be “poison”.