Posted 19 May 2013 - 08:04 PM
As said in the title, the program still things that the function needs an end at line 30
function menu()
term.clear()
term.setCursorPos(1,1)
print("Airship Control")
print("Options: Left, Right, Back, foward, Up, Down")
print("Choose a Direction:")
direction = read()
if direction == "left" or direction == "Left" then
left()
end
if direction == "right" or direction == "Right" then
right()
end
if direction == "foward" or direction == "Foward" then
foward()
end
if direction == "back" or direction == "Back" then
back()
end
if direction == "up" or direction == "Up" then
up()
end
if direction == "down" or direction == "Down" then
down()
end
end
function left()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.blue)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.blue)
rs.setBundledOutput("back", c)
end
menu()
end
function right()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.white)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.white)
rs.setBundledOutput("back", c)
end
menu()
end
function back()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.lime)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.lime)
rs.setBundledOutput("back", c)
end
menu()
end
function foward()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.yellow)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.yellow)
rs.setBundledOutput("back", c)
end
menu()
end
function up()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.red)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.red)
rs.setBundledOutput("back", c)
end
menu()
end
function down()
print("Press Any Button To Stop")
until os.pullEvent("key") do
c = colors.combine(c, colors.orange)
rs.setBundledOutput("back", c)
os.sleep(1)
c = colors.subtract(c, colors.orange)
rs.setBundledOutput("back", c)
end
menu()
end
menu()