6

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.

4

3 Answers 3

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.

1
  • You could temporarily dump items into a second empty barrel for counting so it would eliminate the inventory limit. But it is still probably impractical.
    – mellamokb
    Commented Jun 19, 2013 at 17:19
1

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())
1
0

Cobble Farm

im using Jabba, and what i did was make it detect weather or not slot 1 had more then 1 cobble, and such it would stop.

while true do
 if turtle.getItemCount(1) > 2 then
 else
  turtle.dig()
  turtle.dropDown()
 end
end

the barrel would of course be below the turtle, and when its full the cobble would stack to 2 in the turtle and it would stop.

1
  • i realize this may or may not work because of dropping the cobble in the inventory would be false, so it may or may not drop on the ground. more testing is needed. Commented Mar 23, 2016 at 3:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .