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

Decoy Drill : Python problem



I really don’t get what’s the problem with this code and would appreciate any help.
When I execute this code, I collect 8 to 15 coins and claim “4” to Naria who calls me a liar ( true )
If I delete the last 3 lines, character collects 8 to 15 coins, nothing more happens.
Any ideas ?

decoysBuilt = 0 = 0

item = self.findNearestItem()
# Loot the coin!
itemX = item.pos.x
itemY = item.pos.y
self.moveXY(itemX, itemY)
# Each decoy costs 25 gold. Use the Quartz Sense Stone
# to know when you have more than 25 gold with
if >= 25:
self.buildXY(“decoy”, self.pos.x - 5, self.pos.y)
# Keep a count of decoys you built as you go along.
decoysBuilt = decoysBuilt +1
# Break out of the loop when you have built 4.
elif decoysBuilt == 4:
self.moveXY(14, 36)


I found the solution after all


Hello, Kezako, and welcome. Please format your code according to the FAQ.

You make a variable This is unnecessary. is already an attribute of your player.

Unfortunately, it is impossible to complete further analysis of your code until you format it properly. Please do so.


Hello ChronistGilver,

Thanks for your answer; and I’ll keep that in mind for next time.