Advertisement
Rolcam

Fireworks Launcher Program [WIP]

May 20th, 2021 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.23 KB | None | 0 0
  1. --[[
  2. Fireworks System V1
  3. Made by Rolcam
  4.  
  5. Dispenser Placement Guide:
  6. # = Dispenser number
  7. - = Blocks
  8.  
  9. This is the basic layout for the dispensers (Top down/bird's eye view):
  10. 1---2---3
  11. ---------
  12. ---------
  13. ---------
  14. 8-------4
  15. ---------
  16. ---------
  17. ---------
  18. 7---6---5
  19.  
  20. Wiring Guide:
  21. This is designed to be used with rednet (redstone) cables for the redstone channels.
  22. Use a wrench on the color band to change its channel/color
  23. Dispenser 1: White color band
  24. Dispenser 2: Orange color band
  25. Dispenser 3: Magenta color band
  26. Dispenser 4: Light Blue color band
  27. Dispenser 5: Yellow color band
  28. Dispenser 6: Lime color band
  29. Dispenser 7: Pink color band
  30. Dispenser 8: Gray color band
  31. ]]--
  32. loop = 1
  33. -- Set this to the side the rednet cable will connect to the computer
  34. -- sides: back top left right bottom - keep the "" when changing the side
  35. side = "back"
  36.  
  37. function preLaunch()
  38.     for i = 5, 0, -1 do
  39.         term.clear()
  40.         term.setCursorPos(1,1)
  41.         term.setTextColor(colors.yellow)
  42.         print("Program: "..input.." selected")
  43.         print("Launching in "..i.." seconds")
  44.         sleep(1)
  45.     end
  46. end
  47.  
  48. while loop == 1 do
  49.     term.clear()
  50.     term.setCursorPos(1,1)
  51.     term.setTextColor(colors.yellow)
  52.     print("Please Select Program #: ")
  53.     print("1 - Generic (all 8)")
  54.     print("2 - Half & Half")
  55.     print("3 - Criss Cross (X & +)")
  56.     print("4 - Swirl - CW")
  57.     print("5 - Swirl - CCW")
  58.     print("Exit")
  59.     input = read()
  60.     if input == "1" then
  61.         preLaunch()
  62.         print("Begin firing")
  63.         lTime = 10
  64.         while lTime > 0 do
  65.             rs.setBundledOutput(side, colors.combine(colors.magenta, colors.orange, colors.white, colors.lime, colors.yellow, colors.lightBlue, colors.pink, colors.gray)) 
  66.             sleep(1)
  67.             lTime = lTime - 1
  68.             rs.setBundledOutput(side, 0)
  69.          end
  70.     elseif input == "2" then
  71.         preLaunch()
  72.         lTime = 10
  73.         while lTime > 0 do
  74.             rs.setBundledOutput(side, colors.combine(colors.white, colors.orange, colors.magenta, colors.lightBlue))   
  75.             sleep(1)
  76.             rs.setBundledOutput(side, colors.combine(colors.yellow, colors.lime, colors.pink, colors.gray))
  77.             sleep(1)
  78.             lTime = lTime - 2
  79.             rs.setBundledOutput(side, 0)
  80.          end
  81.     elseif input == "3" then
  82.         preLaunch()
  83.         lTime = 10
  84.         while lTime > 0 do
  85.             rs.setBundledOutput(side, colors.combine(colors.white, colors.magenta, colors.pink, colors.yellow))
  86.             sleep(1)
  87.             rs.setBundledOutput(side, colors.combine(colors.orange, colors.gray, colors.lightBlue, colors.lime))   
  88.             sleep(1)
  89.             lTime = lTime - 2
  90.             rs.setBundledOutput(side, 0)
  91.          end
  92.     elseif input == "4" then
  93.         preLaunch()
  94.         lTime = 5
  95.         while lTime > 0 do
  96.             rs.setBundledOutput(side, colors.white)
  97.             sleep(0.11)
  98.             rs.setBundledOutput(side, colors.orange)   
  99.             sleep(0.11)
  100.             rs.setBundledOutput(side, colors.magenta)  
  101.             sleep(0.11)
  102.             rs.setBundledOutput(side, colors.lightBlue)
  103.             sleep(0.11)
  104.             rs.setBundledOutput(side, colors.yellow)   
  105.             sleep(0.11)
  106.             rs.setBundledOutput(side, colors.lime) 
  107.             sleep(0.11)
  108.             rs.setBundledOutput(side, colors.pink) 
  109.             sleep(0.11)
  110.             rs.setBundledOutput(side, colors.gray) 
  111.             sleep(0.22)
  112.             lTime = lTime - 1
  113.             rs.setBundledOutput(side, 0)
  114.          end
  115.     elseif input == "5" then
  116.         preLaunch()
  117.         lTime = 5
  118.         while lTime > 0 do
  119.             rs.setBundledOutput(side, colors.white)
  120.             sleep(0.11)
  121.             rs.setBundledOutput(side, colors.gray) 
  122.             sleep(0.11)
  123.             rs.setBundledOutput(side, colors.pink) 
  124.             sleep(0.11)
  125.             rs.setBundledOutput(side, colors.lime) 
  126.             sleep(0.11)
  127.             rs.setBundledOutput(side, colors.yellow)   
  128.             sleep(0.11)
  129.             rs.setBundledOutput(side, colors.lightBlue)
  130.             sleep(0.11)
  131.             rs.setBundledOutput(side, colors.magenta)  
  132.             sleep(0.11)
  133.             rs.setBundledOutput(side, colors.orange)   
  134.             sleep(0.22)
  135.             lTime = lTime - 1
  136.             rs.setBundledOutput(side, 0)
  137.          end
  138.     elseif input == "Exit" or input == "exit" then
  139.         loop = 0
  140.     else
  141.             term.setTextColor(colors.red)
  142.             print("Invalid Selection")
  143.             sleep(2)
  144.     end
  145. end            
  146.    
  147.            
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement