Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- term.clear()
- term.setCursorPos(1,1)
- terminatecode = "1059"
- passcode = "1012"
- sideLeft = "left"
- sideRight = "right"
- sideBack = "back"
- sideTop = "top"
- sideBottom = "bottom"
- opentime = 10
- function load()
- term.clear()
- term.setTextColor(colors.green)
- write(" ")
- writeOut("Password Terminal - Floor 0 - Security 4/4", 0.1)
- print("")
- sleep(0.3)
- term.setTextColor(colors.purple)
- write(" ")
- writeOut("-Main.Base.Computer.Network-", 0.0)
- print("")
- sleep(0.3)
- term.setTextColor(256)
- print("===================================================")
- term.setTextColor(colors.blue)
- term.setCursorPos(1, 17)
- writeOut("Dale-OS", 0.1)
- write(" ")
- term.setTextColor(colors.lightBlue)
- writeOut("OS Version ", 0.1)
- sleep(0.1)
- writeOut("2.7", 0.1)
- sleep(0.7)
- term.setTextColor(colors.white)
- print("")
- writeOut("Loading...")
- print("")
- term.clear()
- term.setCursorPos(0, 1)
- menu()
- end
- function menu()
- term.clear()
- term.setCursorPos(0, 1)
- term.setTextColor(colors.green)
- print(" Password Terminal - Floor 0 - Security 4/4")
- sleep(0.3)
- term.setTextColor(colors.purple)
- print(" -Main.Base.Computer.Network-")
- sleep(0.3)
- term.setTextColor(colors.blue)
- write("Dale-OS ")
- term.setTextColor(colors.lightBlue)
- write("OS Version 2.7")
- term.setTextColor(256)
- print("===================================================")
- sleep(0.7)
- term.setTextColor(colors.purple)
- sleep(0.5)
- writeOut("Hello, ", 0.0)
- sleep(0.1)
- writeOut("Please enter a valid parameter:", 0.0)
- print("")
- prompt()
- end
- function prompt()
- term.setTextColor(colors.white)
- write(">>> ")
- input = string.lower(read())
- -- Passcode command --
- if input == passcode then
- term.setTextColor(colors.red)
- print("Please make sure you are on the platform!!")
- sleep(4)
- term.setTextColor(colors.green)
- sleep(1)
- print("Elevator Active...")
- rs.setOutput(sideBottom, true)
- sleep(opentime)
- rs.setOutput(sideBottom, false)
- sleep(opentime)
- os.reboot()
- -- Info command --
- elseif input == "info" then
- term.setTextColor(colors.magenta)
- print("Program made by Dale226")
- sleep(0.3)
- term.setTextColor(colors.blue)
- print("This terminal is on Floor 0")
- sleep(0.3)
- print("This terminals securtiy ranking is, 4 of 4")
- sleep(0.3)
- print("This terminals modem status is: INACTIVE")
- --Termination command--
- elseif input == "exit" then
- write("Exit code: ")
- password = read("*")
- if password == terminatecode then
- error("Program Was Terminated")
- else
- term.setTextColor(colors.red)
- print("Incorrect code")
- end
- --Help command --
- elseif input == "help" then
- help()
- -- Invalid command --
- else
- term.setTextColor(colors.red)
- print("Invalid Command")
- term.setTextColor(colors.white)
- end
- end
- function help()
- term.setTextColor(colors.blue)
- print("List of available commands:")
- sleep(0.5)
- term.setTextColor(colors.lightBlue)
- print("A valid passcode - Activates the elevator")
- sleep(0.3)
- print("Info - Gives info about the system")
- sleep(0.3)
- print("Exit - Terminates the programif proper code is given")
- term.setTextColor(colors.white)
- sleep(1)
- end
- function writeOut(str, slp)
- for i = 1, #str do
- local c = str:sub(i,i)
- write(c)
- sleep(slp)
- end
- end
- load()
- while true do
- prompt()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement