1gA

Computercraft Inventory Detector

1gA
Dec 22nd, 2021 (edited)
271
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. c = peripheral.wrap("back")
  2. r_side = "top"
  3.  
  4. while true do
  5.     items = 0
  6.     for k, item in pairs(c.getAllStacks()) do
  7.         items = items + 1
  8.     end
  9.     if items == 0 then
  10.         redstone.setOutput(r_side, false)
  11.     else
  12.         redstone.setOutput(r_side, true)
  13.     end
  14.     os.sleep(0.05)
  15. end
RAW Paste Data Copied