MarsP4ste

Redstone--emptyBox

Jun 12th, 2021 (edited)
651
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local all = require("component")
  2. local sides = require("sides")
  3. local list = all.list("redstone")
  4. local chest = all.transposer
  5. local count = -1
  6.  
  7. function isntEmpty()
  8.   local counter = 0
  9.   for i, e in ipairs(chest.getAllStacks(sides.down).getAll()) do
  10.     counter = counter + e.size
  11.   end
  12.  
  13.   if count ~= counter and counter ~= 0 then
  14.     count = counter
  15.     return true
  16.   else
  17.     return false
  18.   end
  19. end
  20.  
  21.  
  22. --Main Programm
  23. for add in list do
  24. --    all.proxy(add).setOutput(sides.south,1)
  25. --    all.proxy(add).setOutput(sides.east,1)
  26.     all.proxy(add).setOutput(sides.west,1)
  27.     all.proxy(add).setOutput(sides.north,1)
  28. end
  29.  
  30. while isntEmpty() do
  31.   --print("not Empty")
  32.   os.sleep(2)
  33. end
  34. --print("is empty")
  35.  
  36. for add in list do
  37. --  all.proxy(add).setOutput(sides.south,0)
  38. --  all.proxy(add).setOutput(sides.east,0)
  39.   all.proxy(add).setOutput(sides.west,0)
  40.   all.proxy(add).setOutput(sides.north,0)
  41. end
  42. --print("done")
RAW Paste Data