This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lotso's profile picture

Mining turtle error

Started by Lotso, 11 September 2012 - 07:58 PM
Lotso #1
Posted 11 September 2012 - 09:58 PM
Hye im new to cc using technic pack and when i try and run my programme i get this error "bios:206: [string "hello"]:10: '=' expected"

My code is

while turtle.detectDown() do
print("digging down")
turtle.digDown()
print("going down")
turtle.down()
print("digging forward")
turtle.dig()
print("going foward")
turtle.foward
end

If anyone can help me that will be great thanks.
Lettuce #2
Posted 11 September 2012 - 10:01 PM
You forgot the "r" in forward. Twice. On lines 8 and 9. Simple typo.

–Lettuce
Lotso #3
Posted 11 September 2012 - 10:04 PM
Thank you i didnt see that thats my amazing grammar for you.
icehaunter #4
Posted 11 September 2012 - 10:04 PM
Hello. You need to do like this:

print("going forward")
turtle.forward() -- You forgot brackets here, so bios thought it is a variable. And misspelled "forward".
Lettuce #5
Posted 11 September 2012 - 10:12 PM
Ah. icehaunter, I didn't see that. I saw "foward" and thought "My job here is done."
However, just to add something and prevent this from being pointless, here's a protip. You don't need parenthesis around quotes you print. I see a lot of people doing that, and if you don't need them, it's a pain in the neck to add them every time. I never include them unless I'm printing variables.

print ("Going forward")
Works exactly like

print "Going forward"

May not be proper syntax, but who cares? It works.
icehaunter #6
Posted 11 September 2012 - 10:18 PM
Lettuce, thank you for your advice. But I am am pretty new to lua, i got used to C#. Still struggling with "end" :)/>/>