Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --os.pullEvent = os.pullEventRaw
- local monitor = peripheral.find("monitor")
- function lock()
- if peripheral.find("monitor") then
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.print("Currently Locked")
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- textutils.slowPrint("MC Crafters Security System")
- term.setTextColor(colors.white)
- sleep(1)
- textutils.slowWrite("Username: ")
- user = read()
- textutils.slowWrite("Password: ")
- pass = read("*")
- if user == "Admin" and pass == "password" then
- term.setCursorPos(1,4)
- term.setTextColor(colors.green)
- textutils.slowPrint("Valid Login Credentials, Welcome to The System.")
- if peripheral.find("monitor") then
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.print("Currently Unlocked")
- end
- sleep(2)
- term.clear()
- os.version()
- term.setCursorPos(1,2)
- else
- term.setCursorPos(1,4)
- term.setTextColor(colors.red)
- textutils.slowPint("Invalid Login Credenials, Please Don't Try Again.")
- sleep(2)
- lock()
- end
- end
- if not fs.exists("startup") then
- local file = fs.open("startup", "w")
- file:shell.run("lock")
- file:close()
- os.reboot()
- end
- lock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement