Advertisement
Rolcam

Mall Billboard Program - Condemned Network

Feb 5th, 2024 (edited)
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. This program is designed for use with Computercraft
  3. This is a modern version of the billboard program designed for newer versions of Minecraft (above 1.6.4)
  4. Custom version for: The Condemned Network - The 1.12 Pack player mall
  5. Billboard Specs: 8 blocks wide by 5 blocks tall advanced monitor
  6.  
  7. Programmed by Rolcam
  8. You can copy/modify this program as you wish, just please leave the documentation intact
  9.  
  10. ]]--
  11.  
  12. -- Time variable for how long (in seconds) to display each sign
  13. t = 5
  14.  
  15. --Redirects setup/install output to monitor (for artistic effect)
  16. tSides = {"left","right","bottom","top","front","back"}
  17.  
  18. for i = 1, #tSides do
  19.   monitor = peripheral.wrap(tSides[i])
  20.   if monitor then
  21.         side = tSides[i]
  22.         break
  23.   end
  24. end
  25. --Prevents program termination
  26. os.pullEvent = os.pullEventRaw
  27.  
  28. local currentTerm = term.current()
  29.  
  30.  
  31. function adText()
  32.     term.setTextColor(colors.orange)
  33.     term.setBackgroundColor(colors.black)
  34.     term.setCursorPos(2,19)
  35.     term.write("       Your Ad Here!       ")
  36.     term.setCursorPos(2,20)
  37.     term.write("Contact Rolcam for details!")
  38.     term.setTextColor(colors.white)
  39.     term.setCursorPos(1,1)
  40. end
  41.  
  42. if not fs.exists("boot") then
  43.     term.setTextColor(colors.red)
  44.     print("Warning: boot image missing!")
  45.     print("Downloading image...")
  46.     term.setTextColor(colors.white)
  47.     shell.run("pastebin get edscQ8zU boot")
  48.     term.setTextColor(colors.green)
  49.     print("Boot image downloaded.")
  50.     term.setTextColor(colors.white)
  51. else
  52.     term.setTextColor(colors.green)
  53.     print("boot image found!")
  54.     term.setTextColor(colors.white)
  55. end
  56. img = paintutils.loadImage("boot")
  57.  
  58. term.redirect(monitor)
  59. paintutils.drawImage(img, 1,1)
  60. term.redirect(currentTerm)
  61. term.setBackgroundColor(colors.blue)
  62. term.setTextColor(colors.orange)
  63. term.clear()
  64. print("Rolcam's Billboard Program V3")
  65. term.setTextColor(colors.white)
  66. print(" ")
  67. print("Beginning system check...")
  68. --Checks for missing signs and labels itself
  69. print("Checking signs...")
  70.  
  71. if not fs.exists("image") then
  72.     term.setTextColor(colors.red)
  73.     print("Warning: advert image missing!")
  74.     term.setTextColor(colors.white)
  75.     print("Downloading image...")
  76.     shell.run("pastebin get EZDcTC35 image")
  77.     term.setTextColor(colors.green)
  78.     print("File downloaded")
  79.     term.setTextColor(colors.white)
  80. else
  81.     term.setTextColor(colors.green)
  82.     print("beach image found!")
  83.     term.setTextColor(colors.white)
  84. end
  85. adSign = paintutils.loadImage("image")
  86.  
  87. if not fs.exists("mall") then
  88.     term.setTextColor(colors.red)
  89.     print("Warning: Mall sign is missing!")
  90.     term.setTextColor(colors.white)
  91.     print("Downloading image...")
  92.     shell.run("pastebin get k1dsWddA mall")
  93.     term.setTextColor(colors.green)
  94.     print("File downloaded")
  95.     term.setTextColor(colors.white)
  96. else
  97.     term.setTextColor(colors.green)
  98.     print("Mall sign image found!")
  99.     term.setTextColor(colors.white)
  100. end
  101. if not fs.exists("bar") then
  102.     term.setTextColor(colors.red)
  103.     print("Warning: bar image missing!")
  104.     term.setTextColor(colors.white)
  105.     print("Downloading image...")
  106.     shell.run("pastebin get T2r2qxNj bar")
  107.     term.setTextColor(colors.green)
  108.     print("File downloaded")
  109.     term.setTextColor(colors.white)
  110. else
  111.     term.setTextColor(colors.green)
  112.     print("bar image found!")
  113.     term.setTextColor(colors.white)
  114. end
  115. bar = paintutils.loadImage("bar")
  116. mallImg = paintutils.loadImage("mall")
  117.  
  118. print("Sign check completed!")
  119. print("Checking for computer label")
  120. if os.getComputerLabel() == nil then
  121.     term.setTextColor(colors.red)
  122.     print("Warning: Computer is not labeled!")
  123.     print("Labelling Computer")
  124.     os.setComputerLabel("Billboard Comp")
  125.     term.setTextColor(colors.white)
  126. else
  127.     term.setTextColor(colors.green)
  128.     print("Computer is already labelled. Great!")
  129.     term.setTextColor(colors.white)
  130. end
  131. print("System Check Completed!")
  132. sleep(1)
  133. print("Starting Billboard!")
  134. term.redirect(monitor)
  135.  
  136. mallImg = paintutils.loadImage("mall")
  137.  
  138. while true do
  139.     paintutils.drawImage(mallImg, 1, 1)        
  140.     sleep(15)
  141.     paintutils.drawImage(adSign, 1, 1)        
  142.     sleep(t)
  143.     paintutils.drawImage(bar, 1, 1)
  144.     sleep(t)
  145. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement