Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists(".logInfo") == false then
- shell.run("mkdir .logInfo")
- end
- if fs.exists(".logInfo/user") == false then
- shell.run("pastebin get RxMFL0jM .logInfo/user")
- end
- if fs.exists(".logInfo/pass") == false then
- shell.run("pastebin get ePbRStMG .logInfo/pass")
- end
- os.pullEvent = os.pullEventRaw
- shell.run("gFunctions")
- local function login(usnm,pswd)
- shell.run(".logInfo/user")
- shell.run(".logInfo/pass")
- if usnm == user1 then
- if pswd == pass1 then
- osPrint("Welcome, "..usnm)
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("rom/programs/shell")
- else
- printError("Incorrect username or password!")
- sleep(1)
- os.shutdown()
- end
- elseif usnm == user2 then
- if pswd == pass2 then
- osPrint("Welcome, "..usnm)
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("rom/programs/shell")
- else
- printError("Incorrect username or password!")
- sleep(1)
- os.shutdown()
- end
- else
- printError("Incorrect username or password!")
- sleep(1)
- os.shutdown()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- osWrite("Welcome, would you like to ")
- writeError("R")
- osWrite("estart, ")
- writeError("L")
- osPrint("ogin, or")
- writeError("S")
- osPrint("hutdown?")
- osWrite("> ")
- rd1 = read()
- if rd1 == "R" or rd1 == "r" then
- os.reboot()
- elseif rd1 == "S" or rd1 == "s" then
- os.shutdown()
- elseif rd1 == "L" or rd1 == "l" then
- term.clear()
- term.setCursorPos(1,1)
- osWrite("Username: ")
- rd1 = read()
- osWrite("Password: ")
- ps1 = read("*")
- login(rd1,ps1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement