I am stuck on coincrumbs because it keeps saying that the itemPosition is not defined.
while True:
# This finds the nearest item.
item = hero.findNearestItem()
hero.findNearestItem()
if "coin":
# This stores the item's pos, or position in a variable.
item.Position = item.pos
# Put the X and Y coordinates of the item into variables.
itemX = itemPosition.x
itemY = itemPosition.y
# Now, use moveXY to move to itemX and itemY:
hero.moveXY(itemX,itemY)
while True:
# This finds the nearest item.
item = hero.findNearestItem()
hero.findNearestItem()
if "coin":
# This stores the item's pos, or position in a variable.
item.Position = item.pos
# Put the X and Y coordinates of the item into variables.
coin = hero.findNearestItem()
coinX = coinPosition.x
coinY = coinPosition.y
# Now, use moveXY to move to itemX and itemY:
hero.moveXY(coinX,coinY)