[SOLVED]Copper Meadows Level Help

Hi I need help and here is my code.

# Collect all the coins in each meadow.
# Use flags to move between meadows.
# Press Submit when you are ready to place flags.

while True:
    flag = hero.findFlag()
    if flag:
        pass  # `pass` is a placeholder, it has no effect.
        # Pick up the flag.
        hero.pickUpFlag(flag)
    else:
        # Automatically move to the nearest item you see.
        item = hero.findNearestItem
        if item:
            position = item.pos
            x = position.x
            y = position.y
            hero.moveXY(x, y)

It said that X is undefined

Just move to hero.moveXY(item.pos.x, item.pos.y)

this is the problem replace it with

this

item = hero.findNearestItem()

That isn’t the problem look at something that is essential not a shortcut

Thank you have a good day!

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.