Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- function clear()
- term.clear()
- term.setCursorPos(1)
- end
- function choose2()
- term.clear()
- term.setCursorPos(1,1)
- print(" Log-in <exit>")
- ev, k = os.pullEvent()
- if k == 203 or k == 205 then
- sleep(0.2)
- choose()
- elseif k == 28 then
- term.clear()
- term.setCursorPos(1,1)
- print("----------")
- print("----------")
- print("")
- print("----------")
- print("----------")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("----------")
- print("----------")
- print("000")
- print("----------")
- print("----------")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("----------")
- print("----------")
- print("000000")
- print("----------")
- print("----------")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("----------")
- print("----------")
- print("0000000000")
- print("----------")
- print("----------")
- sleep(1)
- textutils.slowPrint("Shutting down the computer")
- sleep(1)
- os.shutdown()
- else
- sleep(0.2)
- choose2()
- end
- end
- function lock()
- term.clear()
- term.setCursorPos(1,1)
- write"Username: "
- lock = read()
- if lock == "admin" then
- write"Password: "
- lock = read("*")
- if lock == "pass" then
- print("correct please edit some files and make it better")
- else
- textutils.slowPrint("Username or Password incorrect, rebooting computer...")
- sleep(1)
- os.reboot()
- end
- else
- write"Password: "
- input = read("*")
- sleep(0.5)
- textutils.slowPrint("Username or Password is incorrect, rebooting computer...")
- sleep(1)
- os.reboot()
- end
- end
- function guest()
- term.clear()
- term.setCursorPos(1,1)
- sleep(0.5)
- print("Prepare for startup, please wait until done.")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("00000")
- print(" 0")
- print("00000")
- print(" 0")
- print("00000")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("00000")
- print(" 0")
- print("00000")
- print("0")
- print("00000")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print(" 0 ")
- print(" 00 ")
- print("0 0 ")
- print(" 0 ")
- print("00000")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Computer succesfully logged-in!")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Welcome guest")
- textutils.slowPrint("Your options: ")
- textutils.slowPrint("1. Game (default game)")
- textutils.slowPrint("2. About")
- textutils.slowPrint("3. Logg-off")
- textutils.slowPrint("please select your choose by typping 1, 2 or 3")
- q = read()
- if q == "1" then
- shell.run("worm")
- guest()
- elseif q == "2" then
- term.clear()
- term.setCursorPos(1,1)
- print("This is version v0.6")
- print("Made by guusje4525")
- print("")
- print("")
- print("This computer will restart in: ")
- print("00000")
- print("0")
- print("00000")
- print(" 0")
- print("00000")
- sleep(1)
- term.setCursorPos(1,6)
- print("0 0")
- print("0 0")
- print("00000")
- print(" 0")
- print(" 0")
- sleep(1)
- term.setCursorPos(1,6)
- print("00000")
- print(" 0")
- print("00000")
- print(" 0")
- print("00000")
- sleep(1)
- term.setCursorPos(1,6)
- print("00000")
- print(" 0")
- print("00000")
- print("0 ")
- print("00000")
- sleep(1)
- term.setCursorPos(1,6)
- print(" 00 ")
- print("0 0 ")
- print(" 0 ")
- print(" 0 ")
- print("00000")
- sleep(1)
- os.shutdown()
- elseif q == "3" then
- term.clear()
- term.setCursorPos(1,1)
- login()
- else
- print("incorrect option")
- print("the file may removed or check you spelling")
- sleep(1.5)
- guest()
- end
- end
- function login()
- term.clear()
- term.setCursorPos(1,1)
- print(";------------------------------;")
- print("; (Please enter your username);")
- print(";------------------------------;")
- print("; ;")
- print(";------------------------------;")
- print("; (available accounts: ;")
- print("; (admin and guest) ;")
- term.setCursorPos(4,4)
- user = read()
- if user == "guus" then
- print("oo hello guus")
- lock()
- elseif user == "admin" then
- lock()
- else
- guest()
- end
- end
- function choose()
- term.clear()
- term.setCursorPos(1,1)
- print("<Log-in> exit")
- ev, k = os.pullEvent()
- if k == 203 or k == 205 then
- sleep(0.2)
- choose2()
- elseif k == 28 then
- login()
- else
- sleep(0.2)
- choose()
- end
- end
- choose()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement