Checking amount of items in a barrel using computercraft

How can I use computers or turtles to check how many items and stacks are there in a barrel? (Is there any way even?)

Im using MindCrack Feed the beast pack.


Solution 1:

There is no practical way to count the number of items in a barrel using computercraft.

The only way to interact with a barrel (via computercraft) at all is to use a turtle and the only way that a turtle can interact with a barrel is to insert/pull out single stacks of items at a time. This is impractical as a method to count the contents of a barrel as a turtle only has 16 inventory slots available.

Solution 2:

Mods like OpenPeipheral will help you as all they tell ComputerCraft that all containers(Chest, furnace, Anything that stores items) are peripherals. What you can do is

barrel = peripheral.wrap("left")
print(barrel.listMethods())-- see all the methods and find the one you need.
print(barrel.theMethod())