Advertisement
Rolcam

[WIP] - Computercraft/Galacticraft Rocket Silo Launch System

Feb 14th, 2022 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.72 KB | None | 0 0
  1. --[[
  2. Galacticraft Rocket Launching System V1
  3. This program is designed for use in Tekkit (Galacticraft, MineFactory Reloaded*, & Computercraft mods required)
  4.  
  5. *or any mod that uses colored channels for redstone wiring (e.g. bundled cables from "ProjectRed - Transmission")
  6.  
  7. Wiring Guide:
  8. (set the air lock controllers to open on redstone signal - Inverted)
  9. Outputs:
  10.     Air Locks:
  11.         White Channel: Main Air Lock
  12.         Orange: Rocket 1
  13.         Magenta Channel: Rocket 2
  14.         Light Blue Channel: Rocket 3
  15.         Yellow Channel: Rocket 4
  16.         Lime Channel: Rocket 5
  17.         Pink Channel: Rocket 6
  18.  
  19.     Launch Controllers:
  20.         Gray Channel: Controller 3
  21.         Light Gray Channel: Controller 6
  22.  
  23. Important: Please create a program called .config on the computer. Put anything into line 1 of it and save it. This will serve as a storage of the air lock's state. This will get overwritten as the air lock cycles. It defaults to an oxygen sealed state (inner air lock opened, outer air lock sealed)
  24. ]]--
  25.  
  26. timer = function()
  27.     term.setTextColor(colors.yellow)
  28.     x = 30
  29.     while x > 0 do
  30.         term.setCursorPos(1,15)
  31.         write("Launch Completed in: " .. x .. " seconds")
  32.         sleep (0.1)
  33.         x = x - 0.1
  34.     end
  35. end
  36. while true do
  37.     i = 2
  38.     rs.setBundledOutput("back", colors.white)
  39.     term.clear()
  40.     term.setCursorPos(1,1)
  41.     term.setTextColor(colors.orange)
  42.     print("Rocket Silo Launch System")
  43.     print("Rocket 1: ")
  44.     print("Rocket 2: ")
  45.     print("Rocket 3: ")
  46.     print("Rocket 4: ")
  47.     print("Rocket 5: ")
  48.     print("Rocket 6: ")
  49.     while i < 8 do
  50.         term.setCursorPos(11, i)
  51.         term.setTextColor(colors.green)
  52.         write("Ready")
  53.         i = i + 1
  54.     end
  55.     term.setTextColor(colors.blue)
  56.     term.setCursorPos(17,4)
  57.     write("- Cargo Rockets Only")
  58.     term.setCursorPos(17,7)
  59.     write("- Cargo Rockets Only")
  60.     term.setCursorPos(1,8)
  61.     term.setTextColor(colors.orange)
  62.     print("Please select which rocket you want to launch (enter silo number):")
  63.     input = read()
  64.     input = tonumber(input)
  65.     if input == nil then
  66.         term.setTextColor(colors.red)
  67.         print("Error: Invalid Character(s)! Try again")
  68.         sleep(2)
  69.     elseif input > 0 and input <= 6 then
  70.         term.setTextColor(colors.yellow)
  71.         print("Launching Rocket " .. input .. "!")
  72.         term.setCursorPos(11, input + 1)
  73.         term.setTextColor(colors.red)
  74.         write("Launching                                  ")
  75.         if  input == 1 then
  76.             term.setCursorPos(1,10)
  77.             term.setTextColor(colors.yellow)
  78.             print("Begin Launch Sequence. Please enter the rocket ASAP and begin launch countdown!")
  79.             rs.setBundledOutput("back", colors.orange)
  80.             timer()
  81.             rs.setBundledOutput("back", colors.white)
  82.         elseif  input == 2 then
  83.             term.setCursorPos(1,10)
  84.             term.setTextColor(colors.yellow)
  85.             print("Begin Launch Sequence. Please enter the rocket ASAP and begin launch countdown!")
  86.             rs.setBundledOutput("back", colors.magenta)
  87.             timer()
  88.             rs.setBundledOutput("back", colors.white)
  89.         elseif input == 3 then
  90.             term.setCursorPos(1,10)
  91.             term.setTextColor(colors.blue)
  92.             print("Cargo Rocket Auto Launch")
  93.             rs.setBundledOutput("back", colors.lightBlue)
  94.             sleep(3)
  95.             rs.setBundledOutput("back", colors.combine(colors.lightBlue, colors.gray))
  96.             sleep(10)
  97.             rs.setBundledOutput("back", colors.white)
  98.         elseif  input == 4 then
  99.             term.setCursorPos(1,10)
  100.             term.setTextColor(colors.yellow)
  101.             print("Begin Launch Sequence. Please enter the rocket ASAP and begin launch countdown!")
  102.             rs.setBundledOutput("back", colors.yellow)
  103.             timer()
  104.             rs.setBundledOutput("back", colors.white)
  105.         elseif  input == 5 then
  106.             term.setCursorPos(1,10)
  107.             term.setTextColor(colors.yellow)
  108.             print("Begin Launch Sequence. Please enter the rocket ASAP and begin launch countdown!")
  109.             rs.setBundledOutput("back", colors.lime)
  110.             timer()
  111.             rs.setBundledOutput("back", colors.white)
  112.         elseif input == 6 then
  113.             term.setCursorPos(1,10)
  114.             term.setTextColor(colors.blue)
  115.             print("Cargo Rocket Auto Launch")
  116.             rs.setBundledOutput("back", colors.pink)
  117.             sleep(3)
  118.             rs.setBundledOutput("back", colors.combine(colors.pink, colors.lightGray))
  119.             sleep(10)
  120.             rs.setBundledOutput("back", colors.white)
  121.         end
  122.      else
  123.         term.setTextColor(colors.red)
  124.         print("Invalid Selection! Try again")
  125.         sleep(2)
  126.      end
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement