Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

How to get an item's coordinates? (Phyton)


I forgot how to, can someone tell me?


I’m on salted earth, this the code that I put, can anyone help me?
while True:
enemy = hero.findNearestEnemy()
if enemy.type == “munchkin” or enemy.type == “thrower”:
item = hero.findNearestItem()
# Check the item type to make sure the hero doesn’t pick up poison!
# Look for types: ‘gem’ and 'coin’
if item.type == “gem” or item.type == “coin”:
nearItem = hero.distanceTo(item)
hero.moveXY(nearItem, nearItem)



smt.pos.x, smt.pos.y




20 characters minimum…


Oh thanks man, I replaced smt for item, good day sir