Advertisement
Rolcam

ComputerCraft Billboard Program V3

Jun 11th, 2020 (edited)
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.01 KB | None | 0 0
  1. -- Designed for an 8 wide by 5 tall advanced monitor
  2. tSides = {"left","right","bottom","top","front","back"}
  3.  
  4. for i = 1, #tSides do
  5.   monitor = peripheral.wrap(tSides[i])
  6.   if monitor then
  7.         side = tSides[i]
  8.         break
  9.   end
  10. end
  11. --Prevents program termination
  12. os.pullEvent = os.pullEventRaw
  13. local currentTerm = term.current()
  14. --Redirects setup/install output to monitor (for artistic effect)
  15. local monitor = peripheral.wrap(side)
  16. if not fs.exists("boot") then
  17.     term.setTextColor(colors.red)
  18.     print("Warning: boot image missing!")
  19.     print("Downloading image...")
  20.     term.setTextColor(colors.white)
  21.     shell.run("pastebin get edscQ8zU boot")
  22.     term.setTextColor(colors.green)
  23.     print("File downloaded")
  24.     term.setTextColor(colors.white)
  25. else
  26.     term.setTextColor(colors.green)
  27.     print("boot image found!")
  28.     term.setTextColor(colors.white)
  29. end
  30. local img = paintutils.loadImage("boot")
  31. term.redirect(monitor)
  32. paintutils.drawImage(img, 1,1)
  33. term.redirect(currentTerm)
  34. term.setBackgroundColor(colors.blue)
  35. term.setTextColor(colors.orange)
  36. term.clear()
  37. print("Rolcam's Billboard Program V3")
  38. term.setTextColor(colors.white)
  39. print(" ")
  40. print("Beginning system check...")
  41. --Checks for missing signs and labels itself
  42. print("Checking signs...")
  43. if not fs.exists("image") then
  44.     term.setTextColor(colors.red)
  45.     print("Warning: beach image missing!")
  46.     term.setTextColor(colors.white)
  47.     print("Downloading image...")
  48.     shell.run("pastebin get EZDcTC35 image")
  49.     term.setTextColor(colors.green)
  50.     print("File downloaded")
  51.     term.setTextColor(colors.white)
  52. else
  53.     term.setTextColor(colors.green)
  54.     print("beach image found!")
  55.     term.setTextColor(colors.white)
  56. end
  57. if not fs.exists("night") then
  58.     term.setTextColor(colors.red)
  59.     print("Warning: night image missing!")
  60.     term.setTextColor(colors.white)
  61.     print("Downloading image...")
  62.     shell.run("pastebin get KizP2jiT night")
  63.     term.setTextColor(colors.green)
  64.     print("File downloaded")
  65.     term.setTextColor(colors.white)
  66. else
  67.     term.setTextColor(colors.green)
  68.     print("night image found!")
  69.     term.setTextColor(colors.white)
  70. end
  71. if not fs.exists("moon") then
  72.     term.setTextColor(colors.red)
  73.     print("Warning: moon image missing!")
  74.     term.setTextColor(colors.white)
  75.     print("Downloading image...")
  76.     shell.run("pastebin get LL7rSBmx moon")
  77.     term.setTextColor(colors.green)
  78.     print("File downloaded")
  79.     term.setTextColor(colors.white)
  80. else
  81.     term.setTextColor(colors.green)
  82.     print("moon image found!")
  83.     term.setTextColor(colors.white)
  84. end
  85. if not fs.exists("village") then
  86.     term.setTextColor(colors.red)
  87.     print("Warning: village image missing!")
  88.     term.setTextColor(colors.white)
  89.     print("Downloading image...")
  90.     shell.run("pastebin get ncJRFq5J village")
  91.     term.setTextColor(colors.green)
  92.     print("File downloaded")
  93.     term.setTextColor(colors.white)
  94. else
  95.     term.setTextColor(colors.green)
  96.     print("village image found!")
  97.     term.setTextColor(colors.white)
  98. end
  99. if not fs.exists("mars") then
  100.     term.setTextColor(colors.red)
  101.     print("Warning: mars image missing!")
  102.     term.setTextColor(colors.white)
  103.     print("Downloading image...")
  104.     shell.run("pastebin get Xh9Lnr1u mars")
  105.     term.setTextColor(colors.green)
  106.     print("File downloaded")
  107.     term.setTextColor(colors.white)
  108. else
  109.     term.setTextColor(colors.green)
  110.     print("mars image found!")
  111.     term.setTextColor(colors.white)
  112. end
  113. if not fs.exists("bar") then
  114.     term.setTextColor(colors.red)
  115.     print("Warning: bar image missing!")
  116.     term.setTextColor(colors.white)
  117.     print("Downloading image...")
  118.     shell.run("pastebin get T2r2qxNj bar")
  119.     term.setTextColor(colors.green)
  120.     print("File downloaded")
  121.     term.setTextColor(colors.white)
  122. else
  123.     term.setTextColor(colors.green)
  124.     print("bar image found!")
  125.     term.setTextColor(colors.white)
  126. end
  127. print("Sign check completed!")
  128. print("Checking for computer label")
  129. if os.getComputerLabel() == nil then
  130.     term.setTextColor(colors.red)
  131.     print("Warning: Computer is not labeled!")
  132.     print("Labelling Computer")
  133.     os.setComputerLabel("Billboard Comp")
  134.     term.setTextColor(colors.white)
  135. else
  136.     term.setTextColor(colors.green)
  137.     print("Computer is already labelled. Great!")
  138.     term.setTextColor(colors.white)
  139. end
  140. print("System Check Completed!")
  141. sleep(1)
  142. print("Starting Billboard!")
  143. term.redirect(monitor)
  144. local img2 = paintutils.loadImage("image")
  145. local img3 = paintutils.loadImage("bar")
  146. local img4 = paintutils.loadImage("night")
  147. local img5 = paintutils.loadImage("moon")
  148. local img6 = paintutils.loadImage("village")
  149. local img7 = paintutils.loadImage("mars")
  150. sleep(0.5)
  151. x=1
  152. t=5
  153. while true do
  154.   paintutils.drawImage(img2, 1, 1)
  155.   sleep(t)
  156.   paintutils.drawImage(img3, 1, 1)
  157.   sleep(t)
  158.   paintutils.drawImage(img4, 1, 1)
  159.   sleep(t)
  160.   paintutils.drawImage(img5, 1, 1)
  161.   sleep(t)
  162.   paintutils.drawImage(img6, 1, 1)
  163.   sleep(t)
  164.   paintutils.drawImage(img7, 1, 1)
  165.   sleep(t)
  166. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement