←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Deep Storage Unit

awesomness1290's Photo awesomness1290 12 Aug 2014

I would like to know if it is possible to read the contents of a deep storage unit from mfr using a computer. I have a cobble generator pumping cobble into the deep storage unit and i would like to see the amount of cobble on the computer screen. I have Open Peripherals installed if that helps. Thanks If you help.
Quote

Bomb Bloke's Photo Bomb Bloke 13 Aug 2014

To see what - if any - functions OpenPeripheral gives you access to, run its documentation script along with the name of the peripheral (as per the name you'd use to wrap it):

openp/docs <name>

For specific info on given functions, follow that up with:

openp/docs <name> <functionname>

Note that whether or not OpenPeripheral supports your block may depend on both the version of OpenPeripheral and the version of the mod that block comes from. For older OpenPeripheral builds, you may need to install the documentation script manually (see the OpenPeripheral thread for info on this).

For further info on wrapping and using peripherals, take a read through this tutorial.
Quote

awesomness1290's Photo awesomness1290 13 Sep 2014

thanks but it returns with nothing it just goes to the next line
Quote

Bomb Bloke's Photo Bomb Bloke 14 Sep 2014

Where the "it" that does the returning is...?
Quote

ZagKalidor's Photo ZagKalidor 15 Sep 2014

For what i tested so far is that the Deep Storage Unit does not count it's main-content as a slot, like f.e. a chest does. You only may interrogate with the input and output slots of the DSU. The main content is not accessible with a computer.

You'll have to count the items, going into the DSU at the input slot, manually with OpenPeripheral or CCSensors, and write the content to a file.

Maybe newer versions of OP or MFR will support the DSU.
Edited by ZagKalidor, 15 September 2014 - 08:02 AM.
Quote

ZagKalidor's Photo ZagKalidor 15 Sep 2014

Idea for that:

Put a chest adjacent to the dsu and the computer adjacent to the chest. Use the chest as a buffer and check it with openperipheral for full stacks of cobbelstone. Everytime a stack is full with 64 items, use the method "pushIntoSlot" to push the stack into the dsu. Easy you will count the stacks you pushed and then you'll receive the content of the dsu. Write the content to a file to read it when game is loaded.

Write a inputmethod into your code where you can enter the amount of items that you take out of your dsu.

Use a new dsu and pump the contend of the old dsu through bildcraft pipes into the chest.
Quote

awesomness1290's Photo awesomness1290 18 Sep 2014

ok im bad at writing code so could someone write some code that's easy to understand?
Quote