Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Kinuferu

Pairing different components

Question

Hello all!

 

Wasn't quite sure how to phrase the title, but hopefully that will do.

 

Basically, I'm trying to create a sort of base overview program which lets me view data on all my machines (around ~350) from a single location. It will just tell me the essential stuff - power, processing progress, and the item being processed.

 

To do this, I'm using adaptors which get the info from the machine themselves, and an inventory controller upgrade to see the stuff that is being processed by them. One adaptor connects to two machines:

577d0da6e1a16.jpg

 

The issue I've run into however, is matching the inventory controller to the machines it is touching, so that I can print the correct item for the relevant machines. When I use component.list() to see what components are on the network, it just throws them all back in a random order.

 

My only current thought is to manually input every single address and match them within the code - which is very tedious to do (considering how many machines I have) and seems a little bit silly too. It also makes my program useless to everyone except me even with identical setups, and from testing the address for a machine changes when it's replaced, so it would need future maintaining should I change anything.

 

Does anyone know of a way I could somehow organise the machine components so the two machines will match up with the inventory controller they should be paired with? I was thinking of somehow naming machines based on their position relative to the adaptor, or even using location in world (Much easier to change for other users than inputting hundreds of new addresses) - but neither seem to be available.

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Sometimes it is helpful to write a small tool.
To give you an example - it requires you to remove the blocks adding components and rebuilding them in the right order:

pastebin get LCXQ9JH1 factory_companion.lua
factory_companion test.cfg
 [enter number of different components]
 [enter a field name for every component type, can be nested (i.e. "inventory", "furnace.right" or even an empty string to add a list to the root table)]
 [add the stated component to the network; the program listens to "component_added" signals]
 [press enter to save config file]
cat test.cfg

It's just a quick and dirty program. It could have been nicer.

You can take it as an example for a tool of your own.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.