RemiCraft

Setup

Nov 24th, 2021 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --Global Variables--
  2. --userID
  3. --userName
  4.  
  5. --Variables--
  6. userID = os.getComputerID()
  7. userName = ""
  8.  
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. local input
  12. term.write("Running Setup Will Clear")
  13. term.setCursorPos(1,2)
  14. term.write("All Existing Setup Data.")
  15. term.setCursorPos(1,3)
  16. term.write("Continue? (y/n)")
  17. term.setCursorPos(1,4)
  18. input = read()
  19. if input == "n" then
  20.     return
  21. end
  22. if input == "y" then
  23.     term.clear()
  24.     term.setCursorPos(1,1)
  25.     term.write("Setting User ID...")
  26.     term.setCursorPos(1,2)
  27.     userData = fs.open(".user", "w")
  28.     userData.writeLine(userID)
  29.     term.write("User ID Set (" .. userID .. ")")
  30.     term.setCursorPos(1,3)
  31.     term.write("Enter Name Of User:")
  32.     input = read()
  33.     userName = input
  34.     userData.writeLine(input)
  35.     userData.close()
  36.     os.setComputerLabel(userName .. "'s Phone")
  37. else
  38.     shell.run(".setup")
  39. end
Add Comment
Please, Sign In to add comment