Advertisement
DOGGYWOOF

Untitled

Oct 14th, 2024 (edited)
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. local w, h = term.getSize()
  2.  
  3. -- Function to center text horizontally
  4. local function centerText(y, text)
  5. local x = math.floor((w - #text) / 2)
  6. term.setCursorPos(x, y)
  7. term.write(text)
  8. end
  9.  
  10. -- ASCII art dog image
  11. local dogImage = {
  12. " |\\_/| ",
  13. " | @ @ Doggy OS ",
  14. " | <> _ ",
  15. " | _/\\------____ ((| |))",
  16. " | `--' | ",
  17. " _____|_ ___| |___.' ",
  18. "/_/_____/____/_______| "
  19. }
  20.  
  21. -- Function to draw the ASCII art
  22. local function drawASCIIArt(y, textColor)
  23. term.setTextColor(textColor)
  24. for i, line in ipairs(dogImage) do
  25. centerText(y + i - 1, line)
  26. end
  27. end
  28.  
  29. -- Function to display the "Insert bootable medium" message
  30. local function insertBootableMediumMessage()
  31. local message = "Insert bootable medium"
  32. local messageY = h - 5 -- Move the message higher (adjusted position)
  33.  
  34. while true do
  35. term.setBackgroundColor(colors.black)
  36. term.clear()
  37.  
  38. -- Draw the ASCII art
  39. drawASCIIArt(math.floor((h - #dogImage) / 2), colors.white)
  40.  
  41. -- Center and display the message
  42. centerText(messageY, message)
  43.  
  44. -- Wait briefly before clearing and redrawing
  45. os.sleep(1)
  46. end
  47. end
  48.  
  49. -- Main program
  50. insertBootableMediumMessage()
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement