Posted 25 June 2012 - 02:04 AM
Okay so I was working on this program that when you input a command into a computer it would send it to the turtle and the turtle would do so, but I have come across an error that I don't know how to fix.
Computer Code (No Errors)
Turtle Code (Error: string "startup" :23: 'until' expected (to close 'repeat' at line 2)
I would appreciate it if you would help.
Computer Code (No Errors)
rednet.open("right")
term.clear()
term.setCursorPos(16, 1)
print "Turtle Control"
while true do
term.setCursorPos(1, 3)
write "F, L, R, B, M, U, D?"
local input = read()
if input == string.lower("F") then
rednet.send(58,"F")
print "Turtle Forward"
end
if input == string.lower("B") then
rednet.send(58,"B")
print "Turtle Backward"
end
if input == string.lower("L") then
rednet.send(58,"L")
print "Turtle Left"
end
if input == string.lower("R") then
rednet.send(58,"R")
print "Turtle Right"
end
if input == string.lower("U") then
rednet.send(58,"U")
print "Turtle Up"
end
if input == string.lower("D") then
rednet.send(58,"D")
print "Turtle Down"
end
if input == string.lower("M") then
rednet.send(58,"M")
print "Turtle Mined"
end
if input == string.lower("quit") then
break
end
end
Turtle Code (Error: string "startup" :23: 'until' expected (to close 'repeat' at line 2)
rednet.open("right")
repeat
local event,p1,p2,p3 = os.pullEvent()
if event=="rednet_message" and p1==57 then
elseif p2 == "F" then
turtle.forward()
elseif p2 == "B" then
turtle.back()
elseif p2 == "L" then
turtle.turnLeft()
elseif p2 == "R" then
turtle.turnRight()
elseif p2 == "U" then
turtle.up()
elseif p2 == "D" then
turtle.down()
elseif p2 == "M" then
turtle.dig()
elseif p2 == "return" then
for x=1,20 do
turtle.down()
end
end
I would appreciate it if you would help.