[SOLVED] Continuous Alchemy Python

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

sorry fixed code! tis works!:

Mod edit: Glad you figured it out but please don’t post final solutions.

My code doesn’t work! :sweat:

# Use the `continue` statement to avoid poison.
while True:
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    
    # If there is no enemy, continue out of the loop.
    if not enemy:
        continue
    
    # If there is no item, ask for a potion then continue:
    if not item:
        hero.say("Give me a drink!")
        continue
    
    # If the item.type "poison", continue out of the loop.
    if item.type == "poison":
        w
    # At this point, the potion must be a bottle of water
    # so moveXY to the potion, then back to the start!
    hero.moveXY(44, 35)
    hero.moveXY(34, 47)

Nevermind! I fixed it!