Advertisement
Guest User

setup

a guest
Sep 2nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. --[[
  2.     Used the first time you boot your Computer
  3.     into terminal mode on CraftOS 6.2 or above
  4.     to set your username
  5. --]]
  6.  
  7. term.setBackgroundColour(colours.lightBlue)
  8. term.clear()
  9. term.setCursorPos(2, 2)
  10. shell.run("rename CraftOS/Terminal/Boot1 CraftOS/Terminal/setup")
  11.  
  12. print ("Set your password")
  13. print ("---------------------------------------------------")
  14. print ("  ")
  15. write (" Password: ")
  16. name = read ()
  17.  
  18. term.clear()
  19. term.setCursorPos(1, 8)
  20.  
  21. print ("Do you want your password to be "..name.."?")
  22. write ("Y/N ")
  23.  
  24. answer = read ()
  25. if answer == "y" then
  26.  print ("Setting password please wait...")
  27.  SetName = fs.open("CraftOS/Terminal/Password","w")
  28.   if SetName then
  29.    SetName1 = SetName.write()
  30.    SetName.write(name)
  31.    SetName.close()
  32.   end
  33.   sleep(2)
  34. end
  35.  
  36. term.clear()
  37. term.setCursorPos(1, 1)
  38.  
  39. print ("Set your username")
  40. print ("---------------------------------------------------")
  41. print ("  ")
  42. write(" Username: ")
  43. pass = read ()
  44.  
  45. term.clear()
  46. term.setCursorPos(1, 8)
  47.  
  48. print ("Do you want your username to be "..pass.."?")
  49. write("Y/N ")
  50.  
  51. computer = read ()
  52.  if computer == "y" then
  53.   print ("Setting username please wait...")
  54.   SetUser = fs.open("CraftOS/Terminal/Username","w")
  55.   if SetUser then
  56.   SetUser1 = SetUser.write()
  57.   SetUser.write(pass)
  58.   SetUser.close()
  59.   end
  60.   sleep(2)
  61.  end
  62.  
  63. shell.run("rename CraftOS/Terminal/Boot1 CraftOS/Terminal/setup")
  64. term.setBackgroundColour(colours.black)
  65. term.clear()
  66. term.setCursorPos(1, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement