Advertisement
DOGGYWOOF

Untitled

Dec 7th, 2024
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. -- Clear the screen and set up colors
  2. term.clear()
  3. term.setBackgroundColor(colors.black)
  4. term.setTextColor(colors.white)
  5.  
  6. -- Define the width and height of the screen
  7. local width, height = term.getSize()
  8.  
  9. -- Helper function to center text on the screen
  10. local function centerText(y, text, textColor)
  11. local x = math.floor((width - #text) / 2)
  12. term.setCursorPos(x, y)
  13. term.setTextColor(textColor)
  14. term.write(text)
  15. end
  16.  
  17. -- Helper function to draw a loading bar
  18. local function drawLoadingBar(y, percent)
  19. local barWidth = math.floor(width * 0.6) -- Loading bar is 60% of the screen width
  20. local barX = math.floor((width - barWidth) / 2)
  21.  
  22. term.setCursorPos(barX, y)
  23. term.write("[")
  24. for i = 1, barWidth - 2 do
  25. if i <= (barWidth - 2) * (percent / 100) then
  26. term.write("=")
  27. else
  28. term.write(" ")
  29. end
  30. end
  31. term.write("]")
  32. end
  33.  
  34. -- Define the dog ASCII art with white color and @ for eyes
  35. local dogArt = {
  36. " |\\_/| ",
  37. " | @ @ ",
  38. " | <> _ ",
  39. " | _/\\------____ ((| |))",
  40. " | `--' | ",
  41. " _____|_ ___| |___. ",
  42. "/_/_____/____/_______| "
  43. }
  44.  
  45. local startLine = math.floor((height - #dogArt) / 2) - 2
  46.  
  47. -- Display the dog ASCII art with white color
  48. term.setTextColor(colors.white)
  49. for i, line in ipairs(dogArt) do
  50. centerText(startLine + i, line, colors.white)
  51. end
  52.  
  53. -- Display the "Please Wait..." message in white
  54. centerText(startLine + #dogArt + 2, "Please wait...", colors.white)
  55.  
  56. -- Wait for 4 seconds to simulate initialization
  57. sleep(4)
  58.  
  59. -- Clear the "Please Wait..." message
  60. term.clearLine()
  61. centerText(startLine + #dogArt + 2, "", colors.white)
  62.  
  63. -- Display the "Installation in Progress..." message in white
  64. centerText(startLine + #dogArt + 2, "Doggy OS System Installation...", colors.white)
  65.  
  66. -- Simulate a loading bar for the installation process
  67. for i = 1, 100, 5 do
  68. drawLoadingBar(startLine + #dogArt + 4, i)
  69. sleep(0.75) -- Simulate installation process with each increment
  70. end
  71.  
  72. -- Clear the loading bar and "Installing Doggy OS..." message
  73. term.clearLine()
  74. centerText(startLine + #dogArt + 2, "", colors.white)
  75.  
  76. -- New installation process
  77. -- Define paths
  78. local diskPath = "/disk"
  79. local usersPath = diskPath .. "/users"
  80. local recoveryPath = "/recovery"
  81. local rootPath = "/"
  82. local tempUsersPath = rootPath .. "users"
  83.  
  84. -- Move /disk/users/ to the root folder
  85. print("Moving /disk/users/ to root...")
  86. fs.move(usersPath, tempUsersPath)
  87.  
  88. -- Delete /disk/
  89. print("Deleting /disk/...")
  90. fs.delete(diskPath)
  91.  
  92. -- Copy /recovery/ to /disk/
  93. print("Copying /recovery/ to /disk/...")
  94. fs.copy(recoveryPath, diskPath)
  95.  
  96. -- Put the users folder back into /disk/ replacing the current one
  97. print("Restoring /users/ back into /disk/...")
  98. fs.delete(diskPath .. "/users") -- Ensure the old /disk/users/ is removed first
  99. fs.move(tempUsersPath, diskPath .. "/users")
  100.  
  101. print("Operation complete.")
  102.  
  103. -- Display the "Installation Complete!" message in white
  104. centerText(startLine + #dogArt + 2, "Doggy OS Installation Complete!", colors.white)
  105.  
  106. -- Display the countdown message
  107. for i = 5, 0, -1 do
  108. centerText(startLine + #dogArt + 4, "Rebooting in " .. i .. "...", colors.white)
  109. sleep(1)
  110. end
  111.  
  112. -- Wait for 3 seconds before rebooting
  113. sleep(0.5)
  114.  
  115. -- Reboot the system
  116. shell.run("/disk/install-assist")
  117.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement