Advertisement
DOGGYWOOF

Untitled

Jul 6th, 2024 (edited)
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 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. -- Display the dog ASCII art with red Xes for eyes
  19. local dogArt = {
  20. " |\\_/| ",
  21. " | X X SYSTEM ERROR! ",
  22. " | <> _ ",
  23. " | _/\\------____ ((| |))",
  24. " | `--' | ",
  25. " _____|_ ___| |___. ",
  26. "/_/_____/____/_______| "
  27. }
  28.  
  29. local startLine = math.floor((height - #dogArt) / 2) - 2
  30.  
  31. -- Display the dog ASCII art with red Xes for eyes in red
  32. term.setTextColor(colors.red)
  33. for i, line in ipairs(dogArt) do
  34. centerText(startLine + i, line, colors.red)
  35. end
  36.  
  37. -- Display error message below the dog ASCII art in white
  38. term.setTextColor(colors.white)
  39. centerText(startLine + #dogArt + 2, "Cannot boot Doggy OS.", colors.white)
  40. centerText(startLine + #dogArt + 3, "Repair required", colors.white)
  41.  
  42. -- Move "Press Enter to boot into automatic repair." to the bottom in white
  43. centerText(height - 2, "Press Enter to boot into automatic repair.", colors.white)
  44.  
  45. -- Wait for the user to press Enter
  46. while true do
  47. local event, key = os.pullEvent("key")
  48. if key == keys.enter then
  49. -- Boot into automatic repair
  50. term.clear()
  51. term.setCursorPos(1, 1)
  52. print("Loading system repair...")
  53. break
  54. end
  55. end
  56.  
  57. -- Simulate the automatic repair process
  58. -- (You can replace this part with actual repair code)
  59. sleep(2)
  60. print("Repair process complete. Rebooting...")
  61. os.reboot()
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement