Posted 23 February 2014 - 01:13 PM
Hey guys.
So I tried to make a program and its giving me back two errors.
Here's the error
and here is the code:
Thanks in advance
So I tried to make a program and its giving me back two errors.
Here's the error
Bios:206: [string "lights"]:50: 'end' expected
(to close 'while' at line 5)
and here is the code:
term.clear()
term.setCursorPos(16, 1)
print "Light Control System 0.01"
while true do
term.setCursorPos(1, 3)
term.clearLine()
print "Options: Upstairs, Downstairs"
write "Location: "
local input = string.lower( read() )
if input == "upstairs" then
term.clear()
print "Upstairs Lights"
write "On/Off: "
local input = string.lower( read() )
if input == "on" then
term.clear()
redstone.setOutput("left", true)
print"Upstairs lights are on"
end
if input == "off" then
rs.setOutput("left", false)
print "Lights Off"
end
if input == "downstairs" then
term.clear()
print "Downstairs Lights"
write "On/Off: "
local input = string.lower( read() )
if input == "on" then
term.clear()
redstone.setOutput("right", true)
print"Downstairs lights are on"
end
if input == "off" then
rs.setOutput("left", false)
print "Downstairs lights are off"
end
end
if input == "exit" then
break -- Breaks out of the loop and thus exits the program (since there is nothing else outside of the loop in this case).
end
end
Thanks in advance