Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local w, h = term.getSize()
- --Variables
- local user = "Human"
- local pass = "password"
- local uAllow = false
- local pAllow = false
- version = "1.0"
- --Functions
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function printCentered(msg, h)
- term.setCursorPos(w/2 - #msg/2, h)
- write(msg)
- end
- local function printHeader()
- printCentered("Tech Lab os"..version, 1)
- printCentered(" by: Clothespin Fox", 2)
- end
- local function uCheck()
- write("Username: ")
- uInput = read()
- if uInput == user then
- uAllow = true
- else
- print("Username Sbagliato!")
- sleep(2)
- os.reboot()
- end
- end
- local function pCheck()
- write("Password: ")
- pInput = read("*")
- if pInput == pass then
- pAllow = true
- else
- print("Password Sbagliata!")
- sleep(2)
- os.reboot()
- end
- end
- --Main Program
- clear()
- printHeader()
- term.setCursorPos(1,4)
- uCheck()
- if uAllow == true then
- term.setCursorPos(1,5)
- pCheck()
- end
- if uAllow == true and pAllow == true then
- textutils.slowPrint("Loggo . . . . . .")
- sleep(5)
- clear()
- print("Loggato con successo!")
- print("Ora puoi usare il computer!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement