Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("/os/api/tom")
- os.loadAPI("/os/api/button")
- tom.gui()
- tom.gui()
- tom.header("Enter Username:")
- tom.centre("")
- tom.newl()
- for i = 1,15 do
- term.setBackgroundColor(colors.gray)
- term.write(" ")
- end
- term.setCursorPos(2,4)
- q = read()
- name = ("/os/.users/" .. q)
- if fs.exists(name) then
- file = io.open(name, "r")
- pass = file:read()
- term.clear()
- tom.gui()
- tom.header("Enter Password")
- tom.newl()
- x,y = term.getSize()
- junk,y = term.getCursorPos()
- term.setCursorPos((x/2)-1,y)
- passwd = read("*")
- if passwd == pass then
- term.clear()
- tom.gui()
- welcome = ("Welcome " .. q)
- tom.header(welcome)
- tom.centre("")
- current = fs.open("/os/.logon","w")
- current.write(q)
- current.close()
- shell.run("/os/.menu")
- else
- term.clear()
- tom.gui()
- tom.header("INVALID PASSWORD")
- sleep(1)
- tom.centre("Rebooting")
- textutils.slowWrite("...")
- sleep(1)
- os.reboot()
- end
- else
- term.clear()
- tom.gui()
- tom.header("INVALID USERNAME")
- sleep(1)
- tom.centre("Rebooting")
- textutils.slowWrite("...")
- sleep(1)
- os.reboot()
- end
Add Comment
Please, Sign In to add comment