Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local locker = true
- local failed = true
- local attempted_login = true
- local password_server = 11
- securityDoor = false
- rednet.open("top")
- function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- Clear()
- write("Loading... 0%")
- sleep(0.1)
- function MainScreen()
- attempted_login = false
- Clear()
- textutils.slowPrint("Milk Industries Nuclear Reactor Control.nAUTHORISED PERSONNEL ONLY!")
- print("")
- print("Please input the command you wish to perform.")
- print("")
- print("=================================")
- print("1. Login to Control Panaln2. Shutdown")
- print("=================================")
- while true do
- event, var=os.pullEvent("char")
- if var == ("1") then
- Login()
- elseif var ==("2") then
- Shutdown()
- end
- end
- end
- Clear()
- write("Loading... 4%")
- sleep(0.1)
- function Login()
- Clear()
- print("Please enter your username and password.n n")
- LoginInput()
- end
- function LoginInput()
- attempted_loging = true
- print("Username: ")
- username = read()
- print("Password: ")
- serpassword = read("*")
- rednet.send(password_server, username)
- senderId, message, distance = rednet.receive(3)
- if serpassword == message then
- failed = false
- locker = false
- Verified()
- else
- Failed()
- end
- end
- Clear()
- write("Loading... 28%")
- sleep(0.1)
- function Shutdown()
- Clear()
- textutils.slowPrint("Shutting down console...")
- sleep(1)
- os.shutdown()
- end
- Clear()
- write("Loading... 39%")
- sleep(0.1)
- function Failed()
- Clear()
- print("Incorrect login details, please try again.")
- print("")
- LoginInput()
- end
- Clear()
- write("Loading... 51%")
- sleep(0.1)
- function Verified()
- Clear()
- reactorLaunch = false
- write("Welcome! Please choose a command.nn")
- print("===================================")
- print("1. Security Management")
- if reactorLaunch == true then
- print("2. Disable Reactor Monitor")
- else
- print("2. Activate Reactor Monitor")
- end
- print("3. Reactor Controls")
- print("4. Log out")
- print("===================================")
- while true do
- event, var =os.pullEvent("char")
- if var == ("1") then
- Security()
- elseif var ==("2") and reactorLaunch then
- DisableMon()
- elseif var ==("2") then
- EnableMon()
- elseif var ==("3") then
- ReactorCtrl()
- elseif var ==("4") then
- Clear()
- textutils.slowPrint("Logging out...")
- sleep(2)
- Clear()
- os.reboot()
- end
- end
- end
- Clear()
- write("Loading... 72%")
- sleep(0.1)
- function Security()
- Clear()
- textutils.slowPrint("Security Menu. Please enter your command.")
- print("")
- print("===================================")
- if securityDoor == true then
- print("1. Close Reinforced Doors")
- elseif securityDoor == false then
- print("1. Open Reinforced Doors")
- end
- print("2. Main Menu")
- print("===================================n")
- while true do
- event, var =os.pullEvent("char")
- if var == ("1") and securityDoor == true then
- print("Warning! Closing Reinforced Doors!")
- rs.setOutput("back", false)
- sleep(2)
- securityDoor = false
- Security()
- elseif var == ("1") and securityDoor == false then
- print("Warning! Opening Reinforced Doors!")
- rs.setOutput("back", true)
- sleep(2)
- securityDoor = true
- Security()
- elseif var == ("2") then
- Verified()
- end
- end
- end
- Clear()
- write("Loading... 94%")
- sleep(0.1)
- Clear()
- write("Loading... 100%")
- sleep(1)
- while locker do
- MainScreen()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement