Posted 30 October 2012 - 10:05 PM
i have made a program that works like a lever, but i want to add a comment like 'code incorrect' when there is no such code. I am new to the else command and this is my first implementation
could someone review my program and see any problems, it works as long as i dont add a 'else' command.
could someone review my program and see any problems, it works as long as i dont add a 'else' command.
os.pullEvent = os.pullEventRaw -- Disable CTRL-T
while true do -- Code Written By Pedroc1999
term.clear()
term.setCursorPos(1, 1)
print("Please Enter Codes")
input = read("*")
if input == "open" then
redstone.setOutput("back", false)
end
if input == "close" then
redstone.setOutput("back", true)
end
if input == "os" then
term.clear()
term.setCursorPos(1, 1)
print("Returning to CraftOS 1.4")
sleep(1)
print(" ")
print(" 3")
sleep(1)
print(" 2")
sleep(1)
print(" 1")
sleep(1)
term.clear()
term.setCursorPos(1, 1)
error() -- Simply Terminates Program
end
else
print("Code Not Found")
end
end