Advertisement
Guest User

startSetup

a guest
Apr 13th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. passwordNotSet = true
  2. passwordFile = "System/etc/passwd"
  3. userFile = "System/etc/users"
  4. os.loadAPI("System/apis/tntapi")
  5. tntapi.setScreen(1,1,colors.white,colors.blue)
  6. tntapi.easyText("Hello, I am going to help you setup your computer!",2,1,1)
  7. tntapi.easyText("Press any key to get started!",2,1,2)
  8. tntapi.waitKey(1,3,0)
  9. tntapi.setScreen(1,1,colors.white,colors.blue)
  10. tntapi.easyText("Enter a username!",2,1,1)
  11. username = read()
  12. while passwordNotSet do
  13.   tntapi.easyText("Enter a password!",2,1,3)
  14.   password = read("*")
  15.   tntapi.easyText("Repeat your password!",2,1,5)
  16.   passwordr = read("*")
  17.   if passwordr == password then
  18.     passwordNotSet = false
  19.   else
  20.     tntapi.setScreen(1,1,colors.white,colors.blue)
  21.   end
  22. end
  23. tntapi.editFile(passwordFile,password)
  24. tntapi.editFile(userFile,username)
  25. file = tntapi.readFile(passwordFile)
  26. tntapi.setScreen(1,1,colors.white,colors.blue)
  27. tntapi.easyText("Setup complete!",2,1,1)
  28. fs.delete("System/systemsetup.config")
  29. tntapi.editFile("System/systemsetup.config","true")
  30. tntapi.waitKey(1,1)
  31. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement