r/ComputerCraft • • Apr 12 '14

Is it possible for a computer/turtle to open an inventory of an item?

I'm thinking about a program that will collect Mystcraft pages, and when it has a full set, put them into a notebook. I think it would be similar for any sort of bag or handheld chest. Does anyone have some experience with this?

1 Upvotes

5 comments sorted by

3

u/demethan Apr 14 '14

I think with OpenPeripheral you could do that.

1

u/silentdragon14 Apr 21 '14

which perf and a little explanation on how?

1

u/demethan Apr 24 '14

You would need to have the mod added to the pack, if it is not already. From there you can use a turlte to read the content of a chest and pick what is needed to create a full set. then place them in a different chest or have the chest push the page in a writting desk ( pure theory, if the writting desk permit items to be pumped in)

the method is pretty simple.

 chest=peripheral.wrap("front")
 table=chest.getAllStacks()  --get a table with all the chest content.
  
 
  print(chest.getMethods()) --to look at all the methods.

Hope that helps.

1

u/SaintMaskX Apr 14 '14

I'll see if I can't write a little code to do this tonight. I'm thinking a turtle might be able to.