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

Turtle won't move forward

Started by RiokuTheSlayer, 24 April 2013 - 11:13 AM
RiokuTheSlayer #1
Posted 24 April 2013 - 01:13 PM
Hey! RiokuTheSlayer here,and i have a bit of a problem…..

I'm making a program that can control a turtle from a computer.
But the turtle won't move forward or backwards.I can,however,make it rotate.
Here's the code.
Computer:

rednet.open("back")
sleep (1)
print "This is the programs to control the turtle"
sleep (1)
print "Controls: W=Forward S=Backward A=Rotate Left D=Rotate Right."
while true do
local event, param1 = os.pullEvent ("char")
if param1 == "w" then
   rednet.send(1,"W")
elseif param1 == "s" then
   rednet.send(1,"S")
elseif param1 == "a" then
   rednet.send(1,"A")
elseif param1 == "d" then
   rednet.send(1,"D")
end
end

(may have a few space errors from copy/paste)

Turtle:

rednet.open("right")
print("This is the turtle to be controlled.")
sleep(1)
while true do
  local senderId, message, distance = rednet.receive()
   if message == "W" then
	turtle.forward()
   elseif message == "S" then
	turtle.back()
   elseif message == "A" then
	turtle.turnLeft()
   elseif message == "D" then
	turtle.turnRight()
  end
end  

Any help would be greatly appreciated!

Thank you for your time,
RiokuTheSlayer
Engineer #2
Posted 24 April 2013 - 01:16 PM
Put any resource that you can burn in an furna e into the inventory of the turtle and type then 'refuel all'

Now your turtle has fuel to move forward, 1fuel per block
RiokuTheSlayer #3
Posted 24 April 2013 - 01:18 PM
Well,i knew about that.But what if i don't want fuel? i couldn't find the option for it in the file. Could you give me the place it's found? Unless they made it always have to have fuel in the update…
RiokuTheSlayer #4
Posted 24 April 2013 - 01:25 PM
Oh,i found it. thanks for the info!