Advertisement
Guest User

startup.lua

a guest
Jul 3rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. --Startup for gathering information--
  2.  
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. textutils.slowPrint("Add yourself to the system please.")
  6. os.sleep(1)
  7. term.clear()
  8. term.setCursorPos(1,1)
  9. print("Enter desired name: ")
  10. local inputuser = read()
  11. print("Now enter desired password: ")
  12. local inputpass = read()
  13. term.clear()
  14. local newuser = inputuser.."="..inputpass
  15. print("Is user: "..inputuser.." ".."and password: "..inputpass.." ".."correct?")
  16. print("Options: yes or no (case sensitive)")
  17. local option = read()
  18. if option=="yes" then
  19.     print("Done.")
  20.     os.sleep(1)
  21. else
  22.     print("Restarting!")
  23.     os.sleep(1)
  24.     os.reboot()
  25. end
  26.  
  27. --Storing Information--
  28.  
  29. file="users"
  30. local userlist = fs.open(file, "a")
  31. userlist.write(newuser)
  32. userlist.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement