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

[Lua] problems with turtle code

Started by fauxiss, 06 January 2013 - 02:30 PM
fauxiss #1
Posted 06 January 2013 - 03:30 PM
This code is designed to make a small strip mine, 30 blocks in length and 2 blocks high. at the end of the tunnel that it makes, it will dig 3 blocks to the left, then come back making a new 30x2 block tunnel.
It is my first turtle code and I pieced it together from i class on visual basic and looking at other peoples' codes.

http://pastebin.com/mreEYeuT

I keep getting the error:
faux1:5: attempt to call nil
Kingdaro #2
Posted 06 January 2013 - 03:37 PM
Capitalization matters. On that line, it should be "turtle.getFuelLevel()". It should also be "turtle.turnLeft()". The basic capitalization theme in CC is "apiname.someApiFunction()", so if you follow that when using functions, you should be good.
fauxiss #3
Posted 06 January 2013 - 03:44 PM
thanks everything seems to be working. I also had to change the turtle.digup() to turtle.digUp().