Damaged

Processing Program

May 15th, 2015
198
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chest = peripheral.wrap("diamond_0")
  2. extractor = peripheral.wrap("right")
  3. grinder = peripheral.wrap("Grinder_0")
  4. grinderGearbox = peripheral.wrap("AdvancedGears_0")
  5. furnaceOne = peripheral.wrap("container_furnace_1")
  6. furnaceTwo = peripheral.wrap("container_furnace_2")
  7. furnaceOneGearbox = peripheral.wrap("AdvancedGears_2")
  8. furnaceTwoGearbox = peripheral.wrap("AdvancedGears_3")
  9. redstoneCyan = false
  10. redstoneBlue = false
  11. redstoneRed = true
  12. chargingFurnaceOneGearbox = false
  13. chargingFurnaceTwoGearbox = false
  14. chargingGrinderGearbox = false
  15. x = 0
  16. while true do
  17.   x = x + 1
  18.   if x > 9 then
  19.     chest.condenseItems()
  20.     x = 0
  21.   end
  22.   anItem = chest.getStackInSlot(chest.getInventorySize())
  23.   if anItem then
  24.     redstoneRed = false
  25.     print("Found an item in last slot, starting engines")
  26.     processing = true
  27.   end
  28.   slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9 = extractor.printInv()
  29.   if slot1 == "Empty" and slot2 == "Empty" and slot3 == "Empty" and slot4 == "Empty" and slot5 == "Empty" and slot6 == "Empty" and slot7 == "Empty" and slot8 == "Empty" then
  30.     processing = false
  31.   end
  32.   if ( slot2 ~= "Empty" or slot3 ~= "Empty" ) and slot7 == "Empty" then
  33.     redstoneBrown = true
  34.     redstoneLime = false
  35.     print("Speeding up stage 2 and 3")
  36.   else
  37.     redstoneBrown = false
  38.     if ( slot5 ~= "Empty" ) then
  39.       redstoneLime = true
  40.       print("Speeding up stage 4")
  41.     else
  42.       redstoneLime = false
  43.     end
  44.   end
  45.   if furnaceOne.getStackInSlot(1) and chargingFurnaceOneGearbox == false then
  46.     redstonePink = true
  47.     print("Stuff to cook, furnace1")
  48.   else
  49.     redstonePink = false
  50.   end
  51.   if furnaceTwo.getStackInSlot(1) and chargingFurnaceTwoGearbox == false then
  52.     redstoneLightgray = true
  53.     print("Stuff to cook, furnace2")
  54.   else
  55.     redstoneLightgray = false
  56.   end
  57.   a = grinder.printInv()
  58.   if a ~= "Empty" and chargingGrinderGearbox == false then
  59.     redstonePurple = true
  60.     print("Stuff to grind")
  61.   else
  62.     redstonePurple = false
  63.   end
  64.   a,b = furnaceOneGearbox.getEnergy()
  65.   c,d = furnaceTwoGearbox.getEnergy()
  66.   if a < 100000000000 or c < 100000000000 then
  67.     if a < 100000000000 then
  68.       redstonePink = false
  69.       redstoneGray = false
  70.       chargingFurnaceOneGearbox = true
  71.     else
  72.       redstoneLightgray = false
  73.       redstoneGray = true
  74.       chargingFurnaceTwoGearbox = true
  75.     end
  76.     redstoneRed = false
  77.     redstoneCyan = true
  78.     print("A furnace gearbox is low, starting engines to charge")
  79.   else
  80.     e,f = grinderGearbox.getEnergy()
  81.     if e < 100000000000 then
  82.       redstonePurple = false
  83.       redstoneRed = false
  84.       redstoneBlue = true
  85.       chargingGrinderGearbox = true
  86.       print("Grinder gearbox under half, starting engines to charge")
  87.     end
  88.   end
  89.   if ( ( ( chargingFurnaceOneGearbox == true and a > 300000000000 ) or ( chargingFurnaceTwoGearbox == true and c > 300000000000 ) or ( chargingGrinderGearbox == true and e > 300000000000 ) and processing == false ) or (processing == false and chargingFurnaceOneGearbox == false and chargingFurnaceTwoGearbox == false and chargingGrinderGearbox == false ) ) and redstoneRed == false then
  90.     if a > 300000000000 then
  91.       chargingFurnaceOneGearbox = false
  92.     elseif c > 300000000000 then
  93.       chargingFurnaceTwoGearbox = false
  94.     elseif e > 300000000000 then
  95.       chargingGrinderGearbox = false
  96.     end
  97.     redstoneCyan = false
  98.     redstoneBlue = false
  99.     print("Engines not needed, turning off")
  100.     redstoneRed = true
  101.   end
  102.   redstoneOutput = 0
  103.   if redstoneLime then
  104.     redstoneOutput = redstoneOutput + colors.lime
  105.   end
  106.   if redstoneRed then
  107.     redstoneOutput = redstoneOutput + colors.red
  108.   end
  109.   if redstonePink then
  110.     redstoneOutput = redstoneOutput + colors.pink
  111.     print("Trying to run furnace 1")
  112.   end
  113.   if redstoneGray then
  114.     redstoneOutput = redstoneOutput + colors.gray
  115.   end
  116.   if redstoneCyan then
  117.     redstoneOutput = redstoneOutput + colors.cyan
  118.     print("Trying to charge furnace coil(s)")
  119.   end
  120.   if redstoneLightgray then
  121.     redstoneOutput = redstoneOutput + colors.lightGray
  122.     print("Trying to run furnace 2")
  123.   end
  124.   if redstoneBlue then
  125.     redstoneOutput = redstoneOutput + colors.blue
  126.     print("Trying to charge grinder coil")
  127.   end
  128.   if redstonePurple then
  129.     redstoneOutput = redstoneOutput + colors.purple
  130.   end
  131.   if redstoneBrown then
  132.     redstoneOutput = redstoneOutput + colors.brown
  133.   end
  134.   redstone.setBundledOutput("bottom", redstoneOutput)
  135.   os.sleep(2)
  136.   print("Looping")
  137. end
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment