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

Turtle Question

Started by Kav33, 24 October 2012 - 10:53 PM
Kav33 #1
Posted 25 October 2012 - 12:53 AM
I'm currently trying to learn the turtle. I have a fair grasp on Lua but my trouble comes when I try to make the turtle move. When I'm in the turtleOS and in the lua interface my error looks something like -

lua>turtle.forward()
false


I get this everytime and I'm not sure why. I'm in a test world… superflat nothing blocking its path. It won't go up, down or back either. Is there something I'm missing?
briman0094 #2
Posted 25 October 2012 - 01:51 AM
I'm currently trying to learn the turtle. I have a fair grasp on Lua but my trouble comes when I try to make the turtle move. When I'm in the turtleOS and in the lua interface my error looks something like -

lua>turtle.forward()
false


I get this everytime and I'm not sure why. I'm in a test world… superflat nothing blocking its path. It won't go up, down or back either. Is there something I'm missing?

Did you put fuel in the turtle?
Lettuce #3
Posted 25 October 2012 - 03:40 AM
That's a very common mistake. But some don't know how to do it, so here's some short instructions.
The way to do that is to put a fuel, anything that works in a vanilla furnace, in a slot on the turtle, typically coal/charcoal.
Then you have the turtle select that slot, and use turtle.refuel(x).
x is anything you want. This is the amount the turtle consumes. For automated programs, my usual fuel program is:

if turtle.getFuelLevel() <= 5 then --this returns a number, I like a 5 buffer, sometimes you need more or less depending on amount of movement.
   turtle.select(16) --I usually designate slot 16 as my fuel slot.
   turtle.refuel(1) --the amount can depend on your needs, I usually just make it 1.
   turtle.select(1) --Or whatever slot the turtle should be on.
end

Hope that helped, and maybe cleared things up a bit.
–Lettuce
ChunLing #4
Posted 25 October 2012 - 03:51 AM
I go for a fuel buffer of 500, enough to go all the way up and come all the way down. Really, no reason not to fuel your turtles up for the long haul unless you're going to break and replace them. In that case I'd go with a buffer of 50, enough that a single coal puts you over. But I don't have a lot of applications that call for turtles to be initially placed (and moving) in one place and then broken down and placed elsewhere.
Kav33 #5
Posted 25 October 2012 - 04:34 AM
Yeah. The refuel helped alot. Thanks all ^_^/>/>