Decoy Drill Python Version


#1

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???


Help please, Python decoy drill [SOLVED]
#2
  • 1 you don’t need to self.moveXY(14, 36)
  • 2 are there any errors? that can be a problem.

#3

Building decoys is the problem.


#4

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.


#5

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.


#6

Oh, right. You never add to decoysBuilt.