Advertisement
Rolcam

ComputerCraft TV Demo Program

Jun 5th, 2020 (edited)
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.54 KB | None | 0 0
  1. tSides = {"left","right","bottom","top","front","back"}
  2.  
  3. for i = 1, #tSides do
  4.   monitor = peripheral.wrap(tSides[i])
  5.   if monitor then
  6.         side = tSides[i]
  7.         break
  8.   end
  9. end
  10.  
  11.  
  12.  
  13. --Checks for signs and downloads missing signs
  14. if fs.exists("tv1") and fs.exists("tv2") and fs.exists("tv3") and fs.exists("tv4") and fs.exists("tv5") and fs.exists("tv6") and fs.exists("tv7") then
  15. sleep(0.1)
  16. else
  17. shell.run("pastebin","get","KSHdsHvB","tv1")
  18. shell.run("pastebin","get","pDS5GyRJ","tv2")
  19. shell.run("pastebin","get","ZePApwdc","tv3")
  20. shell.run("pastebin","get","8BXD4M3N","tv4")
  21. shell.run("pastebin","get","vJnvjCFM","tv5")
  22. shell.run("pastebin","get","uudA0PZZ","tv6")
  23. shell.run("pastebin","get","H3Rzj0GU","tv7")
  24. shell.run("label", "set", "TV Comp")
  25. end
  26.  
  27. local img = paintutils.loadImage("tv1")
  28. local img2 = paintutils.loadImage("tv2")
  29. local img3 = paintutils.loadImage("tv3")
  30. local img4 = paintutils.loadImage("tv4")
  31. local img5 = paintutils.loadImage("tv5")
  32. local img6 = paintutils.loadImage("tv6")
  33. local img7 = paintutils.loadImage("tv7")
  34. local monitor = peripheral.wrap(side)
  35. term.redirect(monitor)
  36. t = 1
  37. while true do
  38. if redstone.getInput("front") == true then
  39.   paintutils.drawImage(img, 1, 1)
  40. else
  41. monitor.clear()
  42. end
  43.   sleep(t)
  44. if redstone.getInput("front") == true then
  45.   paintutils.drawImage(img2, 1, 1)
  46. else
  47. monitor.clear()
  48. end
  49.   sleep(t)
  50. if redstone.getInput("front") == true then
  51.   paintutils.drawImage(img3, 1, 1)
  52. else
  53. monitor.clear()
  54. end
  55.   sleep(t)
  56. if redstone.getInput("front") == true then
  57.   paintutils.drawImage(img4, 1, 1)
  58. else
  59. monitor.clear()
  60. end
  61.   sleep(t)
  62. if redstone.getInput("front") == true then
  63.   paintutils.drawImage(img5, 1, 1)
  64. else
  65. monitor.clear()
  66. end
  67.   sleep(t)
  68. if redstone.getInput("front") == true then
  69.   paintutils.drawImage(img6, 1, 1)
  70. else
  71. monitor.clear()
  72. end
  73.   sleep(t)
  74. if redstone.getInput("front") == true then
  75.   paintutils.drawImage(img7, 1, 1)
  76. else
  77. monitor.clear()
  78. end
  79.   sleep(t)
  80. if redstone.getInput("front") == true then
  81.   paintutils.drawImage(img6, 1, 1)
  82. else
  83. monitor.clear()
  84. end
  85.   sleep(t)
  86. if redstone.getInput("front") == true then
  87.   paintutils.drawImage(img5, 1, 1)
  88. else
  89. monitor.clear()
  90. end
  91.   sleep(t)
  92. if redstone.getInput("front") == true then
  93.   paintutils.drawImage(img4, 1, 1)
  94. else
  95. monitor.clear()
  96. end
  97.   sleep(t)
  98. if redstone.getInput("front") == true then
  99.   paintutils.drawImage(img3, 1, 1)
  100. else
  101. monitor.clear()
  102. end
  103.   sleep(t)
  104. if redstone.getInput("front") == true then
  105.   paintutils.drawImage(img2, 1, 1)
  106. else
  107. monitor.clear()
  108. end
  109.   sleep(t)
  110. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement