May I ask why does Anya walks straight to Naria to report decoysBuilt? Will appreciate it if you could help me point out my problem.
Below is my code.
We are field testing a new battle unit: the decoy.
Build 4 decoys, then report the total to Naria.
decoysBuilt = 0
self.gold = 0
loop:
item = self.findNearestItem()
# Loot the coin!
x = item.pos.x
y = item.pos.y
self.moveXY(x, y)
# Each decoy costs 25 gold. Use the Quartz Sense Stone
# to know when you have more than 25 gold with self.gold.
self.gold += item.value
if self.gold >=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:
Go to Naria and say how many decoys you built.
self.moveXY(14, 36)
self.say("4")