[en_US.composer.my_buttons_text]
uhhhh
[en_US.composer.my_buttons_text]
ok(2000000000000char)
did you complete it
How should i collect it?
while True:
item = hero.findNearestItem()
hero.move(item.pos)
oh nvm! your the best!!!
no problem(20characters)
hmmm its not working
this is the code
# 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!
while True:
item = hero.findNearestItem()
hero.move(item.pos)
it dies on the first one
hero.moveXY(46, 34)
hero.moveXY(15, 33)
then while true
now it dies from the bottom one and doesnβt go to the top
like this
hero.moveXY(46, 34)
hero.moveXY(15, 33)
while True:
item = hero.findNearestItem()
hero.move(item.pos)
give me your code again
# 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)
while True:
item = hero.findNearestItem()
hero.move(item.pos)
you need to put hero.jumpTo({βxβ: 14, βyβ: 24}) before while true
(I forgot about that)
it says unterminated "
oh you need to change those "