Advertisement
DOGGYWOOF

Untitled

Aug 22nd, 2024 (edited)
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 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. term.clear()
  6.  
  7. -- Define the width and height of the screen
  8. local width, height = term.getSize()
  9.  
  10. -- Helper function to center text on the screen
  11. local function centerText(y, text, textColor)
  12. local x = math.floor((width - #text) / 2)
  13. term.setCursorPos(x, y)
  14. term.setTextColor(textColor)
  15. term.write(text)
  16. end
  17.  
  18. -- Define the dog ASCII art with white color and @ for eyes
  19. local dogArt = {
  20. " |\\_/| ",
  21. " | @ @ ",
  22. " | <> _ ",
  23. " | _/\\------____ ((| |))",
  24. " | `--' | ",
  25. " _____|_ ___| |___. ",
  26. "/_/_____/____/_______| "
  27. }
  28.  
  29. local startLine = math.floor((height - #dogArt) / 2) - 2
  30.  
  31. -- Display the dog ASCII art with white color
  32. term.setTextColor(colors.white)
  33. for i, line in ipairs(dogArt) do
  34. centerText(startLine + i, line, colors.white)
  35. end
  36.  
  37. -- Display the "Insert Disk" message in white
  38. centerText(startLine + #dogArt + 2, "Insert Disk", colors.white)
  39.  
  40. -- Continuously check for /disk/boot/start-check.lua and run it if found
  41. while true do
  42. if fs.exists("/disk/boot/start-check.lua") and not fs.isDir("/disk/boot/start-check.lua") then
  43. -- Run the script using shell.run
  44. shell.run("/disk/boot/start-check.lua")
  45. break -- Exit the loop after running the script
  46. end
  47. sleep(1) -- Wait for a while before checking again
  48. end
  49.  
  50. -- Check if /disk2/ exists before proceeding with the installation script
  51. if fs.exists("/disk2") and fs.isDir("/disk2") then
  52. -- Perform the disk operations
  53. fs.copy("update-backup")
  54. fs.delete("/disk")
  55. sleep(3)
  56. fs.copy("/disk2/","/root")
  57. disk.eject("top")
  58. disk.eject("bottom")
  59. disk.eject("left")
  60. disk.eject("right")
  61. sleep(3)
  62. term.clear()
  63. term.setCursorPos(1,1)
  64. sleep(3)
  65. term.clear()
  66. term.setCursorPos(1,1)
  67. shell.run("rename","/root","/disk")
  68. fs.copy("/disk/","recovery")
  69. print(2)
  70. fs.delete(".settings")
  71. fs.copy("/disk/.settings",".settings")
  72. sleep(2)
  73. shell.run("/disk/install-assist")
  74. else
  75. -- Display a message if /disk2/ is not found
  76. term.setTextColor(colors.red)
  77. print("error")
  78. sleep(3)
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement