THIS IS NOT WORKING!!
# Race munchkins to the water distilled by Omarn Brewstone!
# The continue statement is powerful for managing complicated logic.
# When the program uses the continue statement, the rest of the loop is skipped.
# However, unlike with "break", the loop repeats instead of stopping.
# Use "continue" to verify the conditions of the ambush.
myX = self.pos.x
myY = self.pos.y
# If there is no enemy, continue out of the loop.
loop:
enemy = self.findNearest(self.findEnemies())
item = self.findNearest(self.findItems())
if not enemy:
continue
#self.say("hey, there's an enemy!")
# If there is an enemy, but no item, ask for a potion and continue out of the loop.
self.say("Give me a potion!")
continue
if not item:
continue
# Use an if-statement to check the item's type. If the type is "poison", continue out of the loop.
if item.type is "water":
self.moveXY(item.pos.x, item.pos.y)
self.moveXY(myX, myY)
self.say("Ahhhhhhh, water")
# If it is not, the potion must be a bottle of water, so walk to it and return to the starting position!
else:
continue