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

[SOLVED] Help with key stack


Why is my guy running into the fire-traps?

# Open doors and collect treasures.

peasant = hero.findByType("peasant")[0]

goldKey = peasant.findByType("gold-key")[0]
silverKey = peasant.findByType("silver-key")[0]
bronzeKey = peasant.findByType("bronze-key")[0]

# Command the peasant to pick up the gold and silver keys.
hero.command(peasant, "pickUpItem", goldKey)
hero.command(peasant, "pickUpItem", silverKey)
# Now, command the peasant to pick up the last key:
hero.command(peasant, "pickUpItem", bronzeKey)

# Command the peasant to drop a key near the first door.
hero.command(peasant, "dropItem", {"x": 40, "y": 34})
# The second key -> the second door.
hero.command(peasant, "dropItem", {"x": 31, "y": 34})
# Drop the first (in the stack) key to the last door:
hero.command(peasant, "dropItem", {"x": 23, "y": 35})

# Hurry and collect treasures!
hero.moveXY(10, 34)
hero.jumpTo({"x": 14, "y": 45})
item = hero.findNearestItem()
hero.moveXY(item.pos.x, item.pos.y)
hero.moveXY(14, 42)
hero.blink({"x": 15, "y": 34})
hero.blink({"x": 15, "y": 23})


I think the blink is what’s wrong, maybe you can’t blink through mines, but I don’t have ritic so I can’t test it and I haven’t done that level yet so I’m afraid I can’t help you but Chaboi_3000 (got rid of summons because problem is solved) has ritic and has done that level maybe he can help you.


First I jump then I blink, and those work. When I try to blink or jump again I blow up.


I figured it out. Thanks for helping! :stuck_out_tongue_winking_eye:


That’s fine :grin:, could you put a [SOLVED] in the topic description please, it helps let anyone else now you figured out the problem. Thanks.


I put solved.
(20 characters :rage:)


Private Message next time.


Guys, I could also put [SOLVED] but I wanted the person who made the topic to put [SOLVED] so they can always do it themselves.