-
Notifications
You must be signed in to change notification settings - Fork 2
Storage Monitor
Storage Monitor was written for version 1.0.0 of this mod, and due to some breaking changes will not work as-is on 1.1.0.
However see AutoStock instead, which is an improved version for 1.1.0+.
This is an example (but useful!) script that performs automatic storage management for a list of items.
It will show the amount of items currently stored vs. a target level that you specify, and (if the system knows how to) will automatically craft more items if the storage is below the target.
It currently only supports basic items (without NBT) and only items, not fluid, but it could be extended to support these fairly easily if desired.
You need a computer (standard one is fine), plus some Advanced Monitor blocks (must be advanced), plus the Refined Storage Peripheral block.
The RS Peripheral and one of the Monitor blocks must be touching the computer (or you need to set up some wired modem links) but they can be on any side, although the arrangement above is preferred.
The monitor should be a minimum of 2 blocks wide (3 is recommended), and a minimum of 1 block high (add more height if you want more items).
The RS Peripheral block needs to be connected to your Refined Storage network, via cable or touching another connected RS block.
label set storage
pastebin get PQKLmS5r storage
You'll probably also want to edit startup and set it to:
shell.run("storage")
edit storage
At the top of the file, you'll see a refresh value, which defines how often it checks the storage (you don't want it to be too often, to reduce lag, but often enough that it's not too slow). The default is 10 seconds.
You'll also see a stock list, which is the list of items and quantities to keep in stock. You'll need to specify the internal name of the item (use F3+H to see the item names in tooltips).
The default program will try to keep Sand, Glass, and Stone Bricks in stock, but you can change this to whatever items and quantities that you like.
Start the program by running storage, or by rebooting the computer (if you've set it to run in the startup file).
When the program is running (and RS is online), it displays the names of the items and the current and target quantities on the monitor.
Values are shown in green if you have at least the target quantity of the item in the system. If you don't have enough items, then it shows the values in one of:
- Yellow means that there's currently a crafting task running to make more.
- Orange means that the system knows how to make more but it can't currently start a crafting task (likely you're missing some ingredients that it doesn't know how to craft).
- Red means that the system doesn't know how to craft this item at all.
(And yes, it's safe to have it monitor items that it doesn't know how to craft, if you just want to see it go red if your stock runs low.)
You can open the computer console to see a log of what tasks it's kicking off, or problems it encountered. (To find the exact missing item for the orange state you'll have to use a Grid, however.)
Press ENTER at the computer console to interrupt the program, allowing you to edit it and adjust the stock list. Run storage again to resume.
If you completely run out of a red item (none in storage and no known crafting pattern) then the internal name will appear instead of the "normal" name. This is because it looks the name up via RS, and if there's nothing there it can't translate it.
