Decoy Drill bug?


#1

should be enough said.
Just in case the image is difficult to read or does not show up for some.

“Fix Your Code, Possibly a bug with advance Python feature parsing. unknown expression type: VariableDeclaration.”

In the meantime I am running to town and then reloading the script! Possibly could be on my part.


#2
loop:
    coin = self.findNearestItem()
    pos = item.pos

Where is the item variable declared?


#3

And the actual bug is the single equals on line 16 should be a double equals. I’ve opened a bug here to track getting this error message fixed in our parser: https://github.com/differentmatt/filbert/issues/56


#4

Should it have been coin.pos? I am confused there, stuck on this level for now. Hopefully I will pass soon :slight_smile: Theres a few commands that aren’t listed than I need to figure out and then it shouldn’t be as bad, I believe.

Thanks nick!


#5
coin = self.findNearestItem()
self.moveXY(coin.pos.x, coin.pos.y)

yw :wink:


#6

Yes, that’s correct. You created a coin variable the line before but you’re looking for the pos property of an item variable.

I fear that I jumped on the first issue I saw though. Nick is pointing out that the if statement on line 16 isn’t performing a comparison (==) it’s performing an assignment (=) which is giving the Python interpreter a problem and results in the error message you’re seeing.

if goldtotal = 25:

would be more correct as

if goldtotal == 25:

Hopefully that change should make it easier to debug the rest the solution.


#7

It wasn’t my final code I wanted to toy with it first. I wasn’t trying to grab the coins just yet I was trying to set the positions. Thanks for the == tip I did not know that meant comparison! How could I did out all the commands that aren’t listed clearly? I do not recall seeing == anywhere.


#8

Examples of the language syntax can be seen in the tool tips for the different methods that are available towards the bottom of the edit window. I wouldn’t be surprised if you shortly see some levels that more explicitly teach these concepts. :smile:


#9

Decoy drill has no tips for me in the help window, that is what makes it even more difficult. I like the challenge of it though!


#10

hi, i see people record in "decoy drill " amazingly some people did it under 5 second one of them in only one second can any one help me explain how i am very curious about it