Advertisement
DOGGYWOOF

Untitled

Jun 30th, 2024 (edited)
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. -- Function to draw a bordered box
  2. local function drawBorderedBox(x, y, width, height, borderColor, bgColor)
  3. paintutils.drawBox(x, y, x + width - 1, y + height - 1, borderColor)
  4. paintutils.drawFilledBox(x + 1, y + 1, x + width - 2, y + height - 2, bgColor)
  5. end
  6.  
  7. -- Function to draw centered text
  8. local function drawCenteredText(y, text, textColor, bgColor)
  9. local w, h = term.getSize()
  10. local x = math.floor((w - #text) / 2) + 1
  11. term.setCursorPos(x, y)
  12. term.setTextColor(textColor)
  13. term.setBackgroundColor(bgColor)
  14. term.write(text)
  15. end
  16.  
  17. -- Function to display the splash screen with dog image
  18. local function showSplashScreen()
  19. term.setBackgroundColor(colors.blue)
  20. term.clear()
  21. term.setCursorPos(1, 1)
  22.  
  23. local screenWidth, screenHeight = term.getSize()
  24.  
  25. -- Draw outer border and background
  26. drawBorderedBox(1, 1, screenWidth, screenHeight, colors.lightGray, colors.blue)
  27.  
  28. -- Draw inner filled area
  29. paintutils.drawFilledBox(2, 2, screenWidth - 1, screenHeight - 1, colors.gray)
  30.  
  31. -- Draw title bar
  32. drawBorderedBox(2, 2, screenWidth - 1, 3, colors.lightGray, colors.lightGray)
  33.  
  34. -- Draw title text
  35. drawCenteredText(3, "Doggy OS", colors.blue, colors.lightGray)
  36.  
  37. -- Draw loading message
  38. drawCenteredText(math.floor(screenHeight / 2), "Loading...", colors.black, colors.gray)
  39.  
  40. -- Draw ASCII art dog image
  41. local dogImage = {
  42. " |\\_/| ",
  43. " | @ @ Woof! ",
  44. " | <> _ ",
  45. " | _/\\------____ ((| |))",
  46. " | `--' | ",
  47. " _____|_ ___| |___.' ",
  48. "/_/_____/____/_______| "
  49. }
  50.  
  51. local dogX = math.floor(screenWidth / 2) - 11
  52. local dogY = math.floor(screenHeight / 2) - 4
  53.  
  54. term.setTextColor(colors.yellow)
  55. for i, line in ipairs(dogImage) do
  56. term.setCursorPos(dogX, dogY + i)
  57. term.write(line)
  58. end
  59.  
  60. -- Draw spinning wheel animation
  61. local spinnerFrames = {"|", "/", "-", "\\"}
  62. local spinnerX = math.floor(screenWidth / 2)
  63. local spinnerY = math.floor(screenHeight / 2) + 5
  64. local frameIndex = 1
  65.  
  66. local function animateSpinner()
  67. while true do
  68. term.setCursorPos(spinnerX, spinnerY)
  69. term.setTextColor(colors.white)
  70. term.setBackgroundColor(colors.gray)
  71. term.write(spinnerFrames[frameIndex])
  72. frameIndex = frameIndex % #spinnerFrames + 1
  73. os.sleep(0.2) -- Adjust speed of animation here
  74. end
  75. end
  76.  
  77. -- Start spinner animation in a separate thread
  78. parallel.waitForAny(animateSpinner)
  79. end
  80.  
  81. -- Example usage: Display splash screen
  82. showSplashScreen()
  83.  
  84. -- Simulate loading process (replace with actual boot code)
  85. os.sleep(5) -- Replace with actual initialization process
  86.  
  87. -- Continue with normal boot process
  88. term.setBackgroundColor(colors.black)
  89. term.setTextColor(colors.white)
  90. term.clear()
  91. term.setCursorPos(1, 1)
  92. print("No issues detected. Continuing boot process...")
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement