Please help!
Code:
decoysBuilt = 0
loop:
item = self.findNearestItem()
x = item.pos.x
y = item.pos.y
self.moveXY(x, y)
if self.gold >= 25:
self.moveXY(14, 36)
self.buildXY(“decoy”, 14, 36)
if decoysBuilt = 4:
self.say(“I’ve built “+decoysBuilt+” decoys”)
Anything wrong???
Building decoys is the problem.
Hello, xXABCXx, and welcome. PLease format your code properly according to the FAQ.
You never check for an item. Use an if item
statement.
The comparison operator is ==
, not =
.
You have to move to the X in front of Naria before you can say how many decoys you have built.
The only problem is that every time I collect a coin I say “I built 0 decoys”,then when I build one I say “I built 0 decoys”, then I lost.
Oh, right. You never add to decoysBuilt
.