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

Turtle has to move input steps

Started by MinerStijn, 23 January 2013 - 06:21 AM
MinerStijn #1
Posted 23 January 2013 - 07:21 AM
Hello everyone! I need a program where I type how much steps the turtle has to move. So 5 means 5 stpes forward. I know how to codes work but I don't KNOW all codes and then the right combinations and stuff. Can anyone help? Grtz Miner
sjkeegs #2
Posted 23 January 2013 - 07:33 AM
Are you attempting to figure out how many moves a turtle can perform without refueling? Or something else?

turtle.getFuelLevel() will tell you how much fuel is left in the turtle. Each unit of fuel allows the turtle to move block.
Willibilly19 #3
Posted 23 January 2013 - 07:40 AM
There is a program included on turtles already called go. type "go forward 5" it goes forward 5….same for back, up, and down. another called turn, so "turn left" or "turn right"




tArgs = {...}
length = tArgs[1]

for i = 1, length do
 turtle.forward()
end



Here's the code you asked for though. If you name the file "forward" or whatever….type "forward 5"…it'll go 5.
MinerStijn #4
Posted 24 January 2013 - 02:26 AM
That did it Willi. Thx. Nah it's a basic code I want to implent if one of my other programs :P/> Don't worry about it