This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lxLionHartxl's profile picture

How to grab info of items in a chest?

Started by lxLionHartxl, 22 April 2015 - 02:50 AM
lxLionHartxl #1
Posted 22 April 2015 - 04:50 AM
Hi, I am very new to ComputerCraft and I have been looking around the forum, wiki, browsing through some APIs (on their official website) to see if I can find help about what I have in mind.

I am looking for guides on how to use Advance Computers to do simple features like, determine how many items are in the chest. How many slots taken, how many slots left, what items in the chest, etc. Because I am new to this site and to ComputerCraft, can you point to me where I should start on my programming? (I already watched the some tutorials)

Firstly, I am in a server using Direwolf20 1.7.* mods and the server banned Turtles :angry:/>. So I can't use them even if I wanted to, hence I am left with the basics of ComputerCraft – The Computers itself.

I hope you guys are willing to guide me through this mini project of mine.. Thank you :)/>
flaghacker #2
Posted 22 April 2015 - 06:20 AM
You will have to use a peripheral addon, computercraft doesn't include this functionality (apart from turtles…).

You will have to use a mod that allows you to wrap a chest as a peripheral (openperipherals for example) but it has to be added to the server (not the client). You could try convincing your server owner, good luck.
lxLionHartxl #3
Posted 22 April 2015 - 08:07 AM
Thx for the reply. I see, how would I know if the mod is added to the server?
HPWebcamAble #4
Posted 22 April 2015 - 03:33 PM
If it is installed, all computers should have a directory called 'openp'
I think.

If you have NEI, then you could search for the mod name, or look through the Item Subsets for the mod
flaghacker #5
Posted 22 April 2015 - 05:41 PM
Or even simpler, try getting the peripheral name of a chest.

Place a chest next to a computer (eg. on the right side) and run the lua program, then type this code:

peripheral.getName ("right")
If it prints "chest" or something similar, then then openperipherals is installed.
Edited on 22 April 2015 - 03:42 PM
lxLionHartxl #6
Posted 23 April 2015 - 04:10 AM
Thanks guys, I just checked the server. They do have OpenPeripheral! Time to start learning~