Coincrumbs identifying chest as nearest item

Hello,

Coincrumbs is identifying the chest rather than the coin as the nearest item, and running me over traps and damage.

Any tips? None of the other mentions of this had the same issue, that I found (just slow speed, or not doing xyposition right)

while True:
    # This finds the nearest item.
    item = hero.findNearestItem()
    if item:
        # This stores the item's pos, or position in a variable.
        itemPosition = item.pos
        # Put the X and Y coordinates of the item into variables.
        itemX = itemPosition.x
        itemY = itemPosition.y
        # Now, use moveXY to move to itemX and itemY:
        hero.moveXY(itemX, itemY)

Here you can see the chest gets marked as item, rather than the lower coin. The hero just shows up towarsd the bottom because he’s hit an explosion and been knocked back there.

Do you happen to have the twilight glasses equipped?
if yes, then thats most likely why the hero is going to the chest, since normal glasses cant see through walls and so the hero will never find that chest.

I have fine wooden glasses equipped

Try

if item and item.type == "bronze-coin":

for the if statement

1 Like