Advertisement
DOGGYWOOF

Insert disk

Aug 16th, 2024 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement