3 posts
Posted 26 September 2012 - 09:20 PM
I'm writing a turtle program that I want to make a 1x2 mine shaft. I get,
while true do
turtle.refuel()
turtle.dig()
turtle.digup()
turtle.forward()
end
the error I get is mine:4: attempt to call nil
318 posts
Location
Somewhere on the planet called earth
Posted 26 September 2012 - 09:26 PM
it's
turtle.digUp()
while true do
sleep(0.1) --This is to prevent a stacking error
turtle.dig()
turtle.digUp()
turtle.forward()
end
209 posts
Location
In your fridge.
Posted 26 September 2012 - 11:15 PM
He doesn't need sleep, if it hits end it discards the "brick." (I don't know what to call the program instance it makes.) I don't know why you want a cramped 2*1 tunnel that goes on ad infinitum, but at least you don't need to pause it. It can be 3*1 if you use turtle.digUp() and turtle.digDown(), which is probably better resource-wise, and it uses the same amount of fuel.
Always remember: ComputerCraft uses camelCase. everyTimeYouStartANewWordCapitaliseTheFirstLetterExceptTheFirstWord.
3790 posts
Location
Lincoln, Nebraska
Posted 26 September 2012 - 11:19 PM
Always remember: ComputerCraft uses camelCase. everyTimeYouStartANewWordCapitaliseTheFirstLetterExceptTheFirstWord.
Ha…established, recognized, and accepted formatting… I LAUGH IN YOUR LOGICAL FACE!!!! :P/>/>
I rarely EVER do that when creating new functions. But it is required for existing functions, Lukerules117.
3 posts
Posted 05 October 2012 - 11:15 PM
Thanks and the reason I want a 2*1 tunnel is because I'm mining at the 12th layer.