Posted 13 December 2015 - 02:24 AM
Ok so i really need help, i have a program that opens and shuts me and my friend's door. It works, but when i add this it fails:
else
print "Unknown command."
sleep(1)
shell.run("startup")
I am using 1.7.10, by the way.
Whole thing:
term.setBackGroundColor(colors.pink)
term.setTextColor(colors.white)
shell.run("clear")
print "Hi, what would you like to do?"
print "Options: Open, Close."
print "To exit, Type anything and press enter." (because the else doesnt work)
option = read()
if option == "open" then
shell.run("open")
sleep(0.5)
print "Doors open."
sleep(1)
shell.run("startup")
end
elseif option == "close" then
shell.run("close")
sleep(0.5)
print "Doors closed."
end
else
print "Unknown command."
sleep(1)
shell.run("startup")
Thats all. Heres the error message:
bios:14: [string "startup"]:15: '<eof>' expected
Thanks.
else
print "Unknown command."
sleep(1)
shell.run("startup")
I am using 1.7.10, by the way.
Whole thing:
term.setBackGroundColor(colors.pink)
term.setTextColor(colors.white)
shell.run("clear")
print "Hi, what would you like to do?"
print "Options: Open, Close."
print "To exit, Type anything and press enter." (because the else doesnt work)
option = read()
if option == "open" then
shell.run("open")
sleep(0.5)
print "Doors open."
sleep(1)
shell.run("startup")
end
elseif option == "close" then
shell.run("close")
sleep(0.5)
print "Doors closed."
end
else
print "Unknown command."
sleep(1)
shell.run("startup")
Thats all. Heres the error message:
bios:14: [string "startup"]:15: '<eof>' expected
Thanks.