# HELP key stack immedieately

**URL:** <https://discourse.codecombat.com/t/help-key-stack-immedieately/39780>\
**Category:** Uncategorized\
**Created:** [January 31, 2025, 7:52pm UTC](https://discourse.codecombat.com/t/help-key-stack-immedieately/39780 "2025-01-31T19:52:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Accelerator23](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Accelerator23](https://discourse.codecombat.com/u/Accelerator23)\
**Post date:** [January 31, 2025, 7:52pm UTC](https://discourse.codecombat.com/t/help-key-stack-immedieately/39780/1 "2025-01-31T19:52:45Z")

</div>

```python
# 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": 21, "y": 34})
hero.command(peasant, "move", {"x": 73, "y": 36})
# Hurry and collect treasures!
hero.moveXY(46, 34)
hero.moveXY(15, 33)

```

---

<div class="post-metadata">

**Author:** ![Kyilan\_Davis-Kramer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/kyilan_davis-kramer/32/45009_2.png) [@Kyilan\_Davis-Kramer](https://discourse.codecombat.com/u/Kyilan_Davis-Kramer)\
**Post date:** [February 6, 2025, 2:46pm UTC](https://discourse.codecombat.com/t/help-key-stack-immedieately/39780/2 "2025-02-06T14:46:13Z")

</div>

do you still need help?  
assuming this is 6 days ago  
I’m just asking because I’m here to help if you are

---

<div class="post-metadata">

**Author:** ![Accelerator23](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Accelerator23](https://discourse.codecombat.com/u/Accelerator23)\
**Post date:** [February 6, 2025, 5:59pm UTC](https://discourse.codecombat.com/t/help-key-stack-immedieately/39780/3 "2025-02-06T17:59:15Z")

</div>

no I don’t need help ty for asking!
