That’s what I tried, and it never stops.
Here’s my code.
We are field testing a new battle unit: the decoy.
Build 4 decoys, then report the total to Naria.
decoysBuilt = 0
item = self.findNearestItem()
pos = item.pos
x = pos.x
y = pos.y
# Each decoy costs 25 gold.
# Know when you have more than 25 gold with self.gold
if self.gold >= 25:
newX = self.pos.x - 5
newY = self.pos.y
self.buildXY(“decoy”, newX, newY)
# Keep a count of decoys you built as you go along.
if decoysBuilt == 4:
# Break out of the loop when you have built 4.
self.say(“Done building decoys!”)
Go to Naria and say how many decoys you built.