help with this. I don’t know what is wrong
peasant = hero.findFriends()[0]
# Use "pickUpItem" command to take items.
items = peasant.findItems()
# Use "dropItem" command to put the top item.
# Drop the key near the door to open it.
key = peasant.findNearestByType("gold-key")
# Use peasant.peekItem() to get know the item on the top.
# Mushrooms to the yeti, potions to the hero.
peasant = hero.findFriends()[0]
items = peasant.findItems()
item = hero.findNearest(hero.findItems())
yetiPos = {"x": 61, "y": 44}
yakPos = {"x": 41, "y": 35}
skeletonPos = {"x": 60, "y": 24}
if item:
for item in items:
# Command the peasant "pickUpItem" an item:
hero.command(peasant, "pickUpItem", item)
peasant.peekItem()
while True:
# Check an item on the top of the stack.
topItem = peasant.peekItem()
if not topItem:
break
# If topItem type is "potion":
# If topItem type is "mushroom":
if topItem.type == "mushroom":
# Command to "dropItem" to yetis:
hero.command(peasant, "dropItem", yetiPos)
# If topItem type is "lightstone":
if topItem.type == "potion":
hero.command(peasant, "dropItem", skeletonPos)
# Command to "dropItem" to skeletons:
i’ll try to beat it and i’ll show how I beat it ok @Archion
Thanks but i dont know what is wrong. The peasant stops at when i tell hem to peek at the top item.
I solved it i just had to get the key first
Show me your code because i’m stuck on it to
sure
(Solution removed)
How do i attack after
Every time i say to attack after the code it makes him attack before???
i did it. This is the code use pender with the elementel codex 5 and a wristwatch with time on it
(Solution removed)
Please do not post nor ask for final solutions. They are not permitted on this board. Please feel free to post your non-working code and request assistance. That is what this board is for. Thanks.
Sorry I didn’t know
hmm its not working can someone please help me? this is my code
key = peasant.findNearestByType("gold-key")
# Use peasant.peekItem() to get know the item on the top.
# Mushrooms to the yeti, potions to the hero.
peasant = hero.findFriends()[0]
items = peasant.findItems()
item = hero.findNearest(hero.findItems())
yetiPos = {"x": 61, "y": 44}
yak = {"x": 59, "y": 34}
skeletonPos = {"x": 60, "y": 24}
hero.command(peasant, "pickUpItem", key)
if item:
for item in items:
# Command the peasant "pickUpItem" an item:
hero.command(peasant, "pickUpItem", item)
while True:
topItem = peasant.peekItem()
# Check an item on the top of the stack.
if not topItem:
break
# If topItem type is "potion":
# If topItem type is "mushroom":
if topItem.type == "mushroom":
# Command to "dropItem" to yetis:
hero.command(peasant, "dropItem", yetiPos)
# If topItem type is "lightstone":
if topItem.type == "potion":
hero.command(peasant, "dropItem", skeletonPos)
# Command to "dropItem" to skeletons:
it says cannot read property ‘findNearestByType’ of undefiened
What glasses do you use? Do those glasses have the findNearestByType() method? If not, you can write something like this:
hero.findNearest(hero.findByType(a))
Where a is the type that you are searching.
Andrei
like this
key = peasant.findNearest(peasant.findByType("gold-key"))
and also if i do that line of code at the start it says
Try hero.findNearest()
hmm i changed the
key = peasant.findNearest(peasant.findByType("gold-key"))
to beneath the
item = hero.findNearest(hero.findItems())
edit: now the peasent moves but waits at the door
Then you should put this then:
peasant.findNearest(hero.findByType())
Andrei
now it says findByType’s argument type should have type string but got null
@AnSeDra
What do you mean? Can you show me your code?
Andrei
# Use peasant.peekItem() to get know the item on the top.
# Mushrooms to the yeti, potions to the hero.
peasant = hero.findFriends()[0]
items = peasant.findItems()
item = hero.findNearest(hero.findItems())
key = peasant.findNearest(hero.findByType())
yetiPos = {"x": 61, "y": 44}
yak = {"x": 59, "y": 34}
skeletonPos = {"x": 60, "y": 24}
hero.command(peasant, "pickUpItem", key)
if item:
for item in items:
# Command the peasant "pickUpItem" an item:
hero.command(peasant, "pickUpItem", item)
while True:
topItem = peasant.peekItem()
# Check an item on the top of the stack.
if not topItem:
break
# If topItem type is "potion":
# If topItem type is "mushroom":
if topItem.type == "mushroom":
# Command to "dropItem" to yetis:
hero.command(peasant, "dropItem", yetiPos)
# If topItem type is "lightstone":
if topItem.type == "potion":
hero.command(peasant, "dropItem", skeletonPos)
# Command to "dropItem" to skeletons:
here it is
@AnSeDra