here is my code. My hero just stands there
# Collect 4 gems. Don't touch gems from the inner circle.
# The radius of the gem-trap circle.
innerRadius = hero.distanceTo(hero.findNearestItem())
# This function check that a is definitely greater than b.
def definitelyGreater(a, b):
return a > b + 0.5
center = {"x": 40, "y": 34}
gems = hero.findItems()
# Iterate all gems:
for gem in gems:
# Use definitelyGreater to check if a gem's distance
# is greater than the inner radius:
if len(definitelyGreater > innerRadius):
# Collect the gem.
hero.moveXY(gem.pos.x, gem.pos.y)
# Return to the center.
hero.moveXY(40, 34)
I’m not sure why it isn’t working. Im probably making a rookie mistake @Chaboi_3000 or @SuperSmacker since you guys are online could you help me pls
It is a rookie mistake. You called on the definitelyGreater function wrong.
How do i call it properly again? Sorry I forgot
Look at how the function is defined. Then look at how you called it.
Oooooh. But what do i put in for a, b?
innerRadius and distance to gem
so i would do if len(definitelyGreater, hero.distanceTo(gem) < innerRadius
@SuperSmacker
Dude. why do you need len? I don’t get it dude. Why are you so obsessed with len? I already told you what to do, how to call on the function, what variables to input. It’s up to you to figure it out now.
If I tell you I would literally give the answer away.