[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.wait(2)
hero.blink({"x": 15, "y": 23})

1 Like

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.

1 Like

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.

1 Like

I put solved.
(20 characters :rage:)

Private Message next time.

1 Like

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.

help


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(14, 34)
hero.jumpTo(Vector(14, 50))
hero.moveXY(11, 58)
hero.moveXY(8, 44)
while not(hero.isReady('jump')):
    hero.wait()
hero.jumpTo(Vector(8, 34))
hero.jumpTo(6, 21)
hero.wait(5)
hero.say('wooh')
hero.moveXY(14, 34)
while not(hero.isReady('jump')):
    hero.wait()
hero.jumpTo(Vector(14, 22))
hero.moveXY(10, 11)

@SwyGuy @Deadpool198 what is the command blink? I don’t know how to get ‘blink’

Blink is an ability that the hero Ritic has. He costs 29,000 gems.

What’s the problem with your code? It looks about right. I remember this level being fiddly with trying to get the right co-ordinates to jump to to avoid triggering the mines. Ritic does solve that problem.

Jenny

1 Like

it’s not letting me and also I’m not a subscriber :slightly_frowning_face: :tired_face:

idk how to flag(20char)

someone please help me my code is

# 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(14, 34)
hero.jumpTo(Vector(14, 50))
hero.moveXY(11, 58)
hero.moveXY(8, 44)
while not(hero.isReady('jump')):
    hero.wait()
hero.jumpTo(Vector(17, 34))
hero.moveXY(14, 34)
hero.wait(5)
hero.say('wooh')
hero.moveXY(14, 34)
while not(hero.isReady('jump')):
    hero.wait()
hero.jumpTo(Vector(14, 22))
hero.moveXY(10, 11)

its not working for me and this is my gear


edit:
its goes ok after i go up the firetrap but when i go down i blow up please help
someone please help me its not working ;(
and also when it gets to the hero.moveXY(14, 34) it doesn’t work
@Deadpool198 @jka2706 @Destroyer5023 @JEFF @Gamestack @SwyGuy

my way is different from yours though my hero goes at the firetrap itself and explode the thing but i go to the point where it takes less damage then i collect the treasure

[en_US.composer.my_buttons_text]

ohhhhhh but idk which point that is

[en_US.composer.my_buttons_text]

[en_US.composer.my_buttons_text]

ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm idk what you mean