Retrievulator

The Retrievulator is a block from the TubeStuff mod. It is similar to a Regulator but can be used to automatically restock a chest/crafting table from a Pneumatic Tube network.

A Retrievulator's essential function is to regulate Retrievers to overcome the Pneumatic Tube routing issues (namely, only the closest request on the tube network being fulfilled).

To work, a Retrievulator must be placed next to a powered Retriever on one side and an inventory block such as a chest, relay, or ejector on the other side.

A Retrievulator will monitor a chest or storage device (including Autocrafting Tables) adjacent to its output face to make sure it has enough items to match the inventory template on the "T" side of its GUI. If item levels dip below the "T" side threshold it will send the corresponding item on the "R" side of its GUI to an adjacent Retriever (connected to its input side/face). It will then emit a Redstone pulse triggering the attached Retriever to request the item from a connected chest or tube network. Once item levels again match the "T" side, the Retrievulator will jam the Retriever with a special "stop" item to prevent it from inadvertently being a pass-through or storage buffer.

Retrieve and Transmit/Threshold
Inside the Retrievulator GUI, there are two sections: R for Retrieve, and T for Threshold/Transmit.

Retrieve
The R section is the input buffer. This sets the type and quantity of items to retrieve. All the items in the R section will be placed into the GUI of the Retriever at once. Fill this section first.

Transmit/Threshold
The T section sets a threshold for retrieval. If the connected inventory has fewer items than are present in the T section, the blocks from the R section will remain in the Retriever.

The Retrievulator will emit a constant Redstone signal when the inventory directly next to it contains at least the items in threshold.

It will emit redstone pulses to all adjacent blocks (including the Retriever) when the connected inventory contains fewer items than in the T section. The Retrievulator does not require Blutricity or a redstone signal to work.

Setup


The Retrievulator has an input and an output face. Make sure that the input face is facing the Retriever. The Retriever needs to be powered with Blutricity. Now you must make an input chest and an output chest. The input chest must be connected (with Pneumatic Tubes) to the input face of the Retriever. The output chest must be connected in the same way to the output face of the Retrievulator. (Note: a Retrievulator can output directly into an adjacent storage block without additional tubing)

Now you can fill the Retrievulator's GUI. The R side is the amount the retrievulator will pump into the output chest, and if the output chest gets lower than the T side of the GUI, it will pump the same quantity of items specified in the R side to the output chest again. The input chest can be filled with the resource you want to pump to the output chest.

Example
If you want to stock an Automatic Crafting Table Mk II with the ingredients to make RE Batteries, you could hook a Retriever to three chests (via Redstone Tubes ) containing Tin ingots, Redstone Dust and Copper Wires. On both the R and T sides of the Retrievulator, you would place 4 Tin Ingots, 2 Redstone Dust and 1 Copper Wire. Any time something pulls a battery out of the crafting table, the Retrievulator will check the crafting table's inventory. If there aren't enough ingredients to match what's in the T side, it will signal to the Retriever to pull those ingredients out of the chests, restocking the crafting table.

Note
The spaces in the R and T sides of the GUI directly correspond to one another. If the Retrievulator notices the item in square 1 of the T side is low, it will request the item in square 1 on the R side. If the Bottom middle item (slot 8) on the T side dips too low, it will request the item in the Bottom Middle (slot 8) of the R side. It does not care if the two items match (i.e. you can watch for iron but request diamonds instead of iron).

Also note that multiple stacks of the same item on the T side will all be satisfied at the same time once the target chest/table has the right inventory levels. This means you can't try to monitor for 2 stacks of 64 Iron Ingots on the T side and hope to Retrieve items until there are 128 Iron Ingots (2 x 64 stacks). The retrievulator will ignore both T slots once the first stack of 64 Iron Ingots exists in the attached storage block as technically the storage block now contains 64 Iron Ingots and both conditions are individually satisfied. There is a way to trick the Retrievulator however (see the next Paragraph).

The R/T relations mentioned above can also be used to trick the Retrievulator into pulling items that don't stack (when you need more than one), or pulling items in until multiple stacks of the T items exist. To do this you must "monitor" (in the T section) for an item that will never exist in the target and Request (in the R section) the item that you want which doesn't stack. For example if you're building an MFSU you will need 6 Lapotron Crystals which unfortunately do not stack. Normally you have to place 1 Lapotron Crystal in the R side and 1 in the T side. But this will cause the Retrievulator to stop requesting crystals once the first crystal enters the crafting table. To trick the Retrievulator into pulling in enough Lapotron Crystals, you can place something not in the MFSU recipe (like a piece of dirt) on the T side and have a Lapotron Crystal on the corresponding slot in the R side. The Retrievulator will notice there is no dirt in the Automatic Crafting Table and will request a Lapotron Crystal. Since there will never be dirt in the crafting table, the Retrievulator will constantly try to request additional crystals until it runs out of room. This example should be used for more of a principle of understanding how Retrievulators work rather than actual practice because doing so might cause the Lapotron Crystals to crowd out the space for the recipe's other required parts, meaning your recipe will never get crafted. It is better to connect a second retriever adjacent to the Retrievulator which has been manually configured to pull in a crystal from the network and output to a different Crafting Table face. The Retrievulator won't be able to directly control/jam the adjacent Retriever, but since it is the source of the Redstone signal that triggers the Retrievers requests, it can control the Retriever indirectly. This overcomes the crowding issue because with an Automatic Crafting Table Mk II each input face will be assigned its own private inventory row so the Crystals in our example won't crowd out the other MFE, Advanced Circuits, etc. needed to make the MFSU.

Bugs
The graphics on the Retrievulator are bugged and, if placed by another player in SMP, or after logging out it will appear to flip itself to face downwards. The Retrievulator however will still function normally despite the graphics looking incorrect.