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
Turtle has to move input steps
Started by MinerStijn, Jan 23 2013 07:21 AM
3 replies to this topic
#1
Posted 23 January 2013 - 07:21 AM
#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.
turtle.getFuelLevel() will tell you how much fuel is left in the turtle. Each unit of fuel allows the turtle to move block.
#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"
Here's the code you asked for though. If you name the file "forward" or whatever....type "forward 5"...it'll go 5.
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.
#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
Don't worry about it
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











