when you click submit you have to use the flags to move around
you have to manually put the flags in the area with the coins
i tryed it the hero wouldnt move
take away the pass. 20
to the flag
Delete the pass statement.
ok i took it off
Try what I said above when you click submit
still
take a screenshot of whats happening and put it here
That should be:
flag = hero.findFlag()
how do i do that i forgot
try what @abc said first
thanks
ok so I am gonna mark this topic as solved ok?
ok
Hi I need help and here is my code.
# Collect all the coins in each meadow.
# Use flags to move between meadows.
# Press Submit when you are ready to place flags.
while True:
flag = hero.findFlag()
if flag:
pass # `pass` is a placeholder, it has no effect.
# Pick up the flag.
hero.pickUpFlag(flag)
else:
# Automatically move to the nearest item you see.
item = hero.findNearestItem
if item:
position = item.pos
x = position.x
y = position.y
hero.moveXY(x, y)
It said that X is undefined
Hi please make your own topic for this
umm @milton.jinich They can ask for help because its related to this topic.
dont tell them to make a new topic if their problem is related to the topic
I think itâs undefined because you didnât say who/what you want the position.x and position.y to be defined as.
For example:
x = item.position.x
y = item.position.y
hero.moveXY(x, y)
In this case, you want it to move to the closest item the hero sees, so how would you do that?
Sorry if it doesnât make sense. ![]()
Rachel
Okay well he already made a topic for it. I found the problem