Posted 29 June 2013 - 03:02 PM
Title: Help with moving system
I made a little movement system for turtles and it works fine until it gets to the turn function. the error is that it is expecting 'then' on line 36 when it is clearly there i dont know what else to do.
I made a little movement system for turtles and it works fine until it gets to the turn function. the error is that it is expecting 'then' on line 36 when it is clearly there i dont know what else to do.
function forward()
print("How far do you want to go forward?")
local i = read()
for f = 1, i, 1 do
turtle.forward()
end
end
function up()
print("How far do you want to go up?")
local i = read()
for u = 1, i, 1 do
turtle.up()
end
end
function back()
print("How far do you want to go back?")
local i = read()
for b = 1, i, 1 do
turtle.back()
end
end
function down()
print("How far do you want to go down?")
local i = read()
for d = 1, i, 1 do
turtle.down()
end
end
function turn()
print("Do you want to turn right, left or none?")
local input = read()
if input = right then
print("How many rotations to the right?")
local i = read()
for r = 1, i, 1 do
turtle.turnRight()
end
end
if input = left then
print("How many rotations to the left?")
local i = read()
for l = 1, i, 1 do
turtle.turnLeft()
end
end
if input = none then
end
end
turn()
forward()
up()
back()
down()