Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w, h = term.getSize()
- local door = true
- --Variables
- local user = "Minebox260"
- local pass = "arfolip40"
- local uAllow = false
- local pAllow = false
- version = "1.3.7"
- --Functions
- function BGC(color)
- term.setBackgroundColor(color)
- end
- function clear()
- shell.run("clear")
- end
- function TC(color)
- term.setTextColor(color)
- end
- function printCentered(msg, h)
- term.setCursorPos(w/2 - #msg/2, h)
- write(msg)
- end
- local function printHeader()
- BGC(512)
- shell.run("clear")
- printCentered("NC Security "..version, 1)
- printCentered("Laboratories Entrance", 2)
- end
- local function uCheck()
- term.setTextColor(colors.orange)
- write("Username: ")
- uInput = read()
- if uInput == user then
- uAllow = true
- else
- term.setTextColor(colors.red)
- print("Incorrect Username!")
- sleep(2)
- os.reboot()
- end
- end
- local function pCheck()
- write("Password: ")
- pInput = read("*")
- if pInput == pass then
- pAllow = true
- else
- term.setTextColor(colors.red)
- print("Incorrect Password!")
- sleep(2)
- os.reboot()
- end
- end
- --Main Program
- shell.run("clear")
- printHeader()
- term.setCursorPos(1,4)
- uCheck()
- if uAllow == true then
- term.setCursorPos(1,5)
- pCheck()
- end
- if uAllow == true and pAllow == true then
- term.setTextColor(colors.magenta)
- textutils.slowPrint("Loging in...")
- sleep(2)
- clear()
- term.setTextColor(colors.lime)
- print("Logged in")
- print("Access Granted")
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement