Advertisement
TrueVirusTV

cc-tweaked_boot

Oct 16th, 2022 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.69 KB | None | 0 0
  1. -- # Startup Program for CC:Tweaked # --
  2. -- # Name the program startup to function properly
  3. -- # Version: 1.0
  4.  
  5. local mon = peripheral.find("monitor")
  6. local monX, monY = mon.getSize()
  7. local termX, termY = term.getSize()
  8. mon.setTextScale(1)
  9.  
  10. local title = "Starting... Please wait!"
  11. local len = string.len(title)
  12.  
  13. term.redirect(mon)
  14.  
  15. mon.setBackgroundColor(colors.lightBlue)
  16. mon.clear()
  17.  
  18. mon.setCursorPos((monX - len+1) / 2, monY/2)
  19. mon.write(title)
  20.  
  21. os.sleep(3)
  22.  
  23. mon.setBackgroundColor(colors.black)
  24. mon.clear()
  25.  
  26. local title = "Virus Industries"
  27. local len = string.len(title)
  28.  
  29. mon.setCursorPos((monX - len+1) / 2, (monY/4))
  30. mon.setTextColor(colors.green)
  31. mon.write(title)
  32.  
  33. mon.setTextColor(colors.white)
  34.  
  35. local title = "Loading OS"
  36. local len = string.len(title)
  37. mon.setCursorPos((monX - len+1)/2,(monY/8)*4)
  38. mon.write(title)
  39.  
  40. paintutils.drawBox(3,(monY/8)*6,monX-3,(monY/8)*7,colors.white)
  41.  
  42. local barLength = monX-7
  43.  
  44. mon.setCursorPos(4,(monY/16)*13)
  45. mon.setBackgroundColor(colors.red)
  46. for i=1,barLength do
  47.     mon.write(" ")
  48.     os.sleep(0.1)
  49. end
  50.  
  51.     os.sleep(1)
  52.  
  53. mon.setBackgroundColor(colors.black)
  54. mon.clear()
  55.  
  56. if fs.exists("program") then
  57.     local title = "Loading program.lua"
  58.     local len = string.len(title)
  59.     mon.setCursorPos((monX-len+1)/2,3)
  60.     mon.write(title)
  61.     os.sleep(3)
  62.     shell.run("program")
  63.     else
  64.     local title1 = "No program.lua found."
  65.     local len1 = string.len(title1)
  66.    
  67.     local title2 = "Proceeding normal procedure"
  68.     local len2 = string.len(title2)
  69.    
  70.     mon.setCursorPos((monX-len1+1)/2, 6)
  71.     mon.write(title1)
  72.    
  73.     mon.setCursorPos((monX-len2+1)/2, 8)
  74.     mon.write(title2)
  75.     end
  76.  
  77. os.sleep(1)
  78. mon.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement