Guest User

startup

a guest
May 15th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1. chest = peripheral.wrap("gold_0")
  2. redstoneRed = false
  3. extractor = peripheral.wrap("right")
  4. grinder = peripheral.wrap("Grinder_0")
  5. grinderGearbox = peripheral.wrap("AdvancedGears_0")
  6. while true do
  7.   chest.condenseItems()
  8.   anItem = chest.getStackInSlot(chest.getInventorySize())
  9.   if anItem then
  10.     redstoneRed = false
  11.     print("Found an item in last slot, starting engines")
  12.     processing = true
  13.   end
  14.   slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9 = extractor.printInv()
  15.   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
  16.     redstoneRed = true
  17.     print("All done")
  18.     processing = false
  19.   end
  20.   if ( slot2 ~= "Empty" or slot3 ~= "Empty" ) and slot7 == "Empty" then
  21.     redstoneBrown = true
  22.     print("Speeding up for slow sections")
  23.   else
  24.     redstoneBrown = false
  25.   end
  26.   a = grinder.printInv()
  27.   if a ~= "Empty" then
  28.     redstonePurple = true
  29.     print("Stuff to grind")
  30.   else
  31.     redstonePurple = false
  32.   end
  33.   a,b = grinderGearbox.getEnergy()
  34.   if a < 1000000000 and redstoneRed then
  35.     redstonePurple = false
  36.     redstoneRed = false
  37.     redstoneBlue = true
  38.     print("Grinder gearbox under half, starting engines to charge")
  39.   else
  40.     redstoneBlue = false
  41.     if a > 2000000000 and processing == false then
  42.       print("Engines not needed, turning off")
  43.       redstoneRed = true
  44.     end
  45.   end
  46.   redstoneOutput = 0
  47.   if redstoneRed then
  48.     redstoneOutput = redstoneOutput + colors.red
  49.   end
  50.   if redstoneBlue then
  51.     redstoneOutput = redstoneOutput + colors.blue
  52.   end
  53.   if redstonePurple then
  54.     redstoneOutput = redstoneOutput + colors.purple
  55.   end
  56.   if redstoneBrown then
  57.     redstoneOutput = redstoneOutput + colors.brown
  58.   end
  59.   redstone.setBundledOutput("bottom", redstoneOutput)
  60.   os.sleep(4)
  61.   print("Looping")
  62. end
Advertisement
Add Comment
Please, Sign In to add comment