Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chest = peripheral.wrap("gold_0")
- redstoneRed = false
- extractor = peripheral.wrap("right")
- grinder = peripheral.wrap("Grinder_0")
- grinderGearbox = peripheral.wrap("AdvancedGears_0")
- while true do
- chest.condenseItems()
- anItem = chest.getStackInSlot(chest.getInventorySize())
- if anItem then
- redstoneRed = false
- print("Found an item in last slot, starting engines")
- processing = true
- end
- slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9 = extractor.printInv()
- 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
- redstoneRed = true
- print("All done")
- processing = false
- end
- if ( slot2 ~= "Empty" or slot3 ~= "Empty" ) and slot7 == "Empty" then
- redstoneBrown = true
- print("Speeding up for slow sections")
- else
- redstoneBrown = false
- end
- a = grinder.printInv()
- if a ~= "Empty" then
- redstonePurple = true
- print("Stuff to grind")
- else
- redstonePurple = false
- end
- a,b = grinderGearbox.getEnergy()
- if a < 1000000000 and redstoneRed then
- redstonePurple = false
- redstoneRed = false
- redstoneBlue = true
- print("Grinder gearbox under half, starting engines to charge")
- else
- redstoneBlue = false
- if a > 2000000000 and processing == false then
- print("Engines not needed, turning off")
- redstoneRed = true
- end
- end
- redstoneOutput = 0
- if redstoneRed then
- redstoneOutput = redstoneOutput + colors.red
- end
- if redstoneBlue then
- redstoneOutput = redstoneOutput + colors.blue
- end
- if redstonePurple then
- redstoneOutput = redstoneOutput + colors.purple
- end
- if redstoneBrown then
- redstoneOutput = redstoneOutput + colors.brown
- end
- redstone.setBundledOutput("bottom", redstoneOutput)
- os.sleep(4)
- print("Looping")
- end
Advertisement
Add Comment
Please, Sign In to add comment