Advertisement
Guest User

startup

a guest
Mar 5th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1.  
  2. mkwin("Login")
  3. term.setCursorPos(5, 7)
  4. write("Username: ")
  5. local usr_ = read()
  6. term.setCursorPos(5, 8)
  7. write("Password: ")
  8. local pas_ = read("*")
  9.  
  10. if fs.exists("px/usr/" .. usr_) and fs.exists("px/usr/" .. usr_ .. "/val/pass_" .. pas_) then
  11.   fs.makeDir("px/usr/" .. usr_ .. "/val/islogin")
  12.   term.setCursorPos(10, 15)
  13.   term.setTextColor(colors.blue)
  14.   print("Welcome back, " .. usr_ .. "!")
  15.   sleep(3)
  16.   loginplr = usr_
  17.   loginpas = pas_
  18.   if fs.exists("px/usr/" .. usr_ .. "/val/devmode") then
  19.     devmode = true
  20.   else
  21.     devmode = false
  22.   end
  23.   shell.run("px/usr/" .. usr_ .. "/desktop")
  24.   return loginplr, loginpas, devmode
  25. else
  26.   term.setCursorPos(10, 15)
  27.   term.setTextColor(colors.red)
  28.   print("Invalid username or password.")
  29.   sleep(3)
  30.   shell.run("px/sys/startup")
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement