r/ComputerCraft • u/1ncursio998 • May 04 '24
Is there a way to automatically identify the chests connected as peripherals on my computer by purpose?
Hey there, I'm building an automated felling system, and the chests can be categorised into following three different types:
- Input Chest - Users insert saplings and bone meals to start feliing
- Central Chest - Chests to collect felled trees
- Output Chest - Chests that will be automatically sorted through the central chest and finally saved
Here what I want to know is, Is there a way to automatically identify the chests connected as peripherals on my computer by purpose? The only idea I can think of right now is to write the names of the chests with purpose in config.lua, which would be very tedious to do manually, and I'd like to avoid doing it every time there is a change to the chests. Do you have any good ideas for this?
5
Upvotes
3
u/Bright-Historian-216 May 04 '24
Can you read the name of a chest through peripheral? If not, maybe identify them by first item?
2
u/ex3or May 04 '24
You can track them by activities, ofc more code and planning into that but. Example, all can be coded to be evaluated at runtime:
Other option: Add renamed 'filter' item (like paper, or cobble, something NOT used in farm or sorting) in last slot of each chest and categorize chests by name of that item. (Easier and faster than previous idea)
2
u/PitifulQuiet218 May 04 '24
There's a way to list ALL peripherals, then match the name 'chest' and put them all into a list
2
u/Equivalent_Ice_1770 May 04 '24
You can specify peripherals by the side its touching the computer. Left right top and bottom