Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Alchemic Power Help


My pet can’t touch the potion it just flies over and bounces back.

def onHear(event):
    # Find the nearest potion.
    potion = pet.findNearestByType("potion")
    # If the event's message is "Fetch"
    if event.message is "Fetch":
        pet.moveXY(62, 34)
    # Else (for any other messages):
        # Return the pet to the red mark.
        pet.moveXY(54, 34)

pet.on("hear", onHear)


The pet should fetch potions, not collect them.


Thanks that worked perfectly.