Posted 17 January 2017 - 05:05 AM
Hey guys, I am away from home right now and cannot run this code through CC but I have been able to use Notepad++. I would like to know if this code will run through Computercraft. It is a simple start to an OS but I would like to make sure that I am on the right track. Thank you very much. If you have any critiques I am more than happy to hear them.
-- ColtOS
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("ColtOS 0.1")
print("1 - Create Account")
print("2 - Login")
print("Any other key to exit to lua prompt")
input = read()
if input == "1" then {
term.clear()
term.setCursorPos(1,1)
-- Username Creation
write("Please Enter A Username:")
local username = ( read() )
term.clear()
term.setCursorPos(1,1)
-- Pass Creation
write("Thank you! Now, a Password:")
local password = ( read() )
term.clear()
term.setCursorPos(1,1)
}
-- Login
if input == "2"
write("Login")
write("Username:")
if input = local username then {
write("Password:")
else
-- Incorrect User
write("User not found.")
if input = local password then {
term.clear()
term.setCursorPos(1,1)
print("ColtOS")
-- Incorrect Pass
else
term.clear()
term.setCursorPos(1,1)
print("Incorrect!")
os.reboot()
}
}
else
term.clear()
term.setCursorPos(1,1)
end