Advertisement
Virgilcore

RobcOS Setup

Jun 9th, 2022 (edited)
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local configTable = {Name, Password, "1.1.2"}
  4.  
  5. function save(table,name)
  6. local file = fs.open(name,"w")
  7. file.write(textutils.serialize(table))
  8. file.close()
  9. end
  10.  
  11. function writeName()
  12.     Name = read()
  13.     term.clear()
  14.     term.setCursorPos(1, 3)
  15.     term.write("Your computer is now named:")
  16.     term.setCursorPos(1, 4)
  17.     term.write(Name)
  18.     os.sleep(1)
  19.     table.insert(configTable, 1, Name)
  20. end
  21.  
  22. function writePass()
  23.     Password = read()
  24.     term.clear()
  25.     term.setCursorPos(1, 3)
  26.     term.write("Your Password is now:")
  27.     term.setCursorPos(1, 4)
  28.     term.write(Password)
  29.     os.sleep(1)
  30.     table.insert(configTable, 2, Password)
  31. end
  32.  
  33. term.clear()
  34. term.setCursorPos(1, 1)
  35. term.write("Welcome to the SETUP program.")
  36. term.setCursorPos(1, 2)
  37. term.write("Please Write your Desired computer Name.")
  38. term.setCursorPos(1, 3)
  39. writeName()
  40. term.clear()
  41. term.setCursorPos(1, 2)
  42. term.write("Please Write your Desired Password.")
  43. term.setCursorPos(1, 3)
  44. writePass()
  45. os.sleep(2)
  46. os.setComputerLabel("ROBCO UNIVERSAL TERMINAL")
  47. fs.makeDir("/R_Files")
  48. fs.makeDir("/R_Files/Documents")
  49. fs.makeDir("/R_Files/Programs")
  50. save(configTable, "RobcOS_ticket")
  51. os.reboot()
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement