while True:
item = hero.findNearestItem()
# A silver coin has a value of 2.
# Collect if item.type is equal to “coin”
# AND item.value is equal to 2.
if item.type == “coin” and item.value == 2:
hero.moveXY(item.pos.x, item.pos.y)
# A blue gem has a value of 10.
# Collect if item.type is equal to “gem”
# AND item.value is equal to 10.
if item.type == “gem” and item.value == 10:
hero.moveXY(item.pos.x, item.pos.y)
hero.moveXY(item.pos.x, item.pos.y)
but then I don’t collect all of the gems and coins. I think it is a bug.
Gosh people.
Read the FAQ before you post! format your code using Beautiful Formating!
I can’t read that, so I can’t help you
reformat your code according to FAQ, thank you.
while True:
item = hero.findNearestItem()
# A silver coin has a value of 2.
# Collect if item.type is equal to “coin”
# AND item.value is equal to 2.
if item.type == “coin” and item.value == 2:
hero.moveXY(item.pos.x, item.pos.y)
# A blue gem has a value of 10.
# Collect if item.type is equal to “gem”
# AND item.value is equal to 10.
if item.type == “gem” and item.value == 10:
hero.moveXY(item.pos.x, item.pos.y)
All I need is that the seed always change. Also the spawn point for the coins are all over the place and gems. Need 3 gems and coins. but I got 1 gem and 3 coins