-- http://cdn.clearbackblast.com/dcs/cc/sps.lua local input_barrel = 'radioactiveWasteBarrel_2' local output_barrel = 'radioactiveWasteBarrel_1' local control_face = 'right' local input = peripheral.wrap(input_barrel) local output = peripheral.wrap(output_barrel) function shouldEnable() return input.getStored().amount == input.getCapacity() end function shouldDisable() return output.getStored().amount < 2000 end function setState(state) redstone.setOutput(control_face, state) end function logMessage(message) print(os.clock() .. ': ' .. message) end logMessage('Watching I/O and handling state...') while true do if shouldEnable() then logMessage('Power on') setState(true) end if shouldDisable() then logMessage('Power off') setState(false) end logMessage('...') sleep(1) end