Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Defining Functions. Please Standby.")
- write("0%")
- function MainScreen()
- term.clear()
- term.setCursorPos(1,1)
- print("This console has been locked by an Administrator.")
- print("Please choose from the following options:")
- print("1: Local Login.")
- print("2: Network Login.")
- print("Please Select the number for the option chosen.")
- while true do -- starts a loop
- event ,var = os.pullEvent("char")
- if var == ("1") then
- LocalLogin()
- elseif var == ("2") then -- added then here
- NetworkLogin()
- end
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("10%")
- function LocalLogin()
- term.clear()
- term.setCursorPos(1,1)
- print("This console has been locked by an administrator.")
- print("Please input your credentials.")
- print("Username: ")
- var1 = read()
- print("Password: ")
- var2 = read()
- if var1 == ("LocalAdmin") and var2 ==("AdminBypass") then
- LocalAccepted()
- else
- LoginFailed()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("20%")
- function LocalAccepted()
- var0 = ("0")
- print("Local login accepted. Some features have been disabled.")
- print("Please choose from the following options: ")
- print("1: Initiate Tunnel Lockdown Procedure.")
- print("2: Initiate Tunnel Release Procedure.")
- print("3: Log Out.")
- print("4: Shutdown.")
- print("Please enter the number of the chosen option.")
- r = os.pullEvent("char")
- if r == ("1") then
- Close()
- elseif r == ("2") then -- added then
- Open()
- elseif r == ("3") then -- added then
- MainScreen()
- elseif r == ("4") then -- added then
- Shutdown()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("30%")
- function NetworkLogin()
- term.clear()
- term.setCursorPos(1,1)
- print("Please input your credentials for network login.")
- print("Username: ")
- var1 = read()
- print("Password: ")
- var2 = read()
- rednet.open("top")
- rednet.send(13, var1)
- message = rednet.receive()
- if message == ("Continue") then
- rednet.send(13, var2)
- else
- LoginFailed()
- end
- message = rednet.receive()
- if message == ("Approved") then
- Menu()
- else
- LoginFailed()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("40%")
- function LoginFailed()
- term.clear()
- term.setCursorPos(1,1)
- print("Login Failed. Try Again? Y/N")
- r = os.pullEvent("char")
- if r == ("y") then
- MainScreen()
- elseif r == ("n") then -- added then
- Shutdown()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("50%")
- function LogOut()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowWrite("Initiating console lock sequence. stand by.")
- sleep(3)
- MainScreen()
- end
- term.clear()
- term.setCursorPos(1,1)
- write("60%")
- function Menu()
- term.clear()
- term.setCursorPos(1,1)
- var0 = ("1")
- print("Network Login Accepted. Please choose from the following Options.")
- print("1: Initiate Tunnel Lockdown Procedure.")
- print("2: Initiate Tunnel Release Procedure.")
- print("3: Broadcast alert sequence.")
- print("4: shutdown alert sequence.")
- print("5: Log Out.")
- print("6: Shutdown.")
- r = os.pullEvent("char")
- if r == ("1") then
- Close()
- elseif r == ("2") then
- Open()
- elseif r == ("5") then
- LogOut()
- elseif r == ("6") then
- Shutdown()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("70%")
- function Open()
- textutils.slowPrint("Sending release codes. Stand by.")
- rednet.open("top")
- rednet.send(ID, "open") -- dont quite understand what you are trying here -- rednet.send(##, "open")
- rednet.close("top")
- if var0 == ("0") then -- when comparing two vars we use == not =
- LocalAccepted()
- elseif var0 == ("1") then -- when comparing two vars we use == not =
- Menu()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("80%")
- function Close()
- textutils.slowPrint("Sending lockdown code. Stand by.")
- rednet.open("top")
- rednet.send(ID, "Close") -- dont quite understand what you are trying here -- rednet.send(##, "Close")
- rednet.close("top")
- if var0 == ("0") then -- when comparing two vars we use == not =
- LocalAccepted()
- elseif var0 == ("1") then -- when comparing two vars we use == not =
- Menu()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- write("90%")
- function Shutdown()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Shutting down Operating System...")
- sleep(1)
- os.shutdown()
- end
- term.clear()
- term.setCursorPos(1,1)
- write("100%")
- sleep(2)
- MainScreen()
Advertisement
Add Comment
Please, Sign In to add comment