Advertisement
DOGGYWOOF

Untitled

Sep 30th, 2024 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 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. -- Function to display the error screen
  19. local function showErrorScreen()
  20. -- Display the dog ASCII art with red Xes for eyes
  21. local dogArt = {
  22. " |\\_/| ",
  23. " | ? ? KERNEL ERROR! ",
  24. " | <> _ ",
  25. " | _/\\------____ ((| |))",
  26. " | `--' | ",
  27. " _____|_ ___| |___. ",
  28. "/_/_____/____/_______| "
  29. }
  30.  
  31. local startLine = math.floor((height - #dogArt) / 2) - 2
  32.  
  33. -- Display the dog ASCII art with red Xes for eyes in red
  34. term.setTextColor(colors.red)
  35. for i, line in ipairs(dogArt) do
  36. centerText(startLine + i, line, colors.yellow)
  37. end
  38.  
  39. -- Display error message below the dog ASCII art in white
  40. term.setTextColor(colors.white)
  41. centerText(startLine + #dogArt + 2, "Kernel Power Loss", colors.white)
  42. centerText(startLine + #dogArt + 3, "", colors.white)
  43.  
  44. -- Move "Please contact support." to the bottom in white
  45. centerText(height - 2, "Press F1 To continue boot", colors.white)
  46.  
  47. -- Keep the screen static with the error message
  48. while true do
  49. sleep(1)
  50. end
  51. end
  52.  
  53. -- Check if ACPI.signal exists
  54. if not ACPI or not ACPI.signal then
  55. showErrorScreen()
  56. else
  57. -- Check if the file exists and run it
  58. if fs.exists("/disk/boot/start-check.lua") then
  59. shell.run("/disk/boot/start-check.lua")
  60. else
  61. -- If the file doesn't exist, show error screen
  62. showErrorScreen()
  63. end
  64. end
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement