Advertisement
Guest User

startup

a guest
Jan 9th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. -- What PqtatoOS calls you - Default: Pqtato
  2. local name = "Pqtato"
  3. -- What you want PqtatoOS to be called - Default: PqtatoOS
  4. local osName = "PqtatoOS" -- No longer used
  5. -- DO NOT CHANGE THIS!
  6. local version = "1.0.0"
  7. -- Your password. Example: bacon Default: cheese
  8. local password = "cheese"
  9. -- Centered Text
  10. local function centerText(text)
  11.   local w, h = term.getSize()
  12.   term.setCursorPos(math.floor(w / 2 - text:len() / 2 + .5), math.floor(h / 2 + .5))
  13.   io.write(text)
  14. end
  15. local function centerText2(text)
  16.   local w, h = term.getSize()
  17.   term.setCursorPos(math.floor(w / 2 - text:len() / 2 + .5), math.floor(h / 2 + 1.5))
  18.   io.write(text)
  19. end
  20.  
  21. -- Startup
  22. term.setBackgroundColor(colors.cyan)
  23. term.setTextColor(colors.white)
  24. shell.run("pqtatoos/.openModem")
  25. term.clear()
  26. term.setCursorPos(1,1)
  27. centerText("Why hello there!")
  28. sleep(3)
  29. term.clear()
  30. term.setCursorPos(1,1)
  31. print("Username: ", name)
  32. term.setCursorPos(1,2)
  33. print("Password: ")
  34. term.setCursorPos(11,2)
  35. inputP = read('*')
  36.  
  37. if(inputP == password) then
  38.   term.setBackgroundColor(colors.black)
  39.   term.setTextColor(colors.white)
  40.   term.clear()
  41.   term.setCursorPos(1,1)
  42.   print("PqtatoOS ", version)
  43.   term.setCursorPos(1,2)
  44. else
  45.   print("Incorrect password!")
  46.   sleep(3)
  47.   os.reboot()
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement