Overview
This is a full guide that will explain all the features of my Inventory Manager script.You can find the script here: http://steamcommunity.com/sharedfiles/filedetails/?id=1216126863
Basic Setup
The basic setup is very easy. You just need a programmable block with the script and that’s it! Below you have a step by step description of what to do:
- subscribe to my script in the workshop (see link in the title)
- build a programmable block
- open it in the terminal
- press ‘Edit’
- in the new window, press ‘Browse Workshop’
- select my script ‘Isy’s Inventory Manager’ and press ‘Ok’
- the code now appears in the window
- press ‘Check Code’ and ‘Ok’ in the popup window
- press ‘Remember & Exit’ and you’re done
The script is now running with all its basic settings and all your containers should already be sorted.
For a more visual, video guide, watch my youtube video:
Note: Game has to be in experimental mode and ingame scripts have to enabled in world options!
How to do that, I explained here:
Sorting
All items are sorted based on their type into different containers. Docked ships or vehicles are also emptied. To prevent that temporary, have a look at the upcoming guide topics.
You can also change the keyword, a container has to contain to be recognized as a type specific container, in the config section. Just make sure that they are unique as the script will find matching keywords in parts of block names as well.
Exclude containers from sorting
By adding the ‘Locked’ keyword to any block’s name, this block is excluded from sorting. This could be useful if you are preparing a container with things, you want to take with you on your next trip.
Locked containers will also be excluded as a source for any balancing method (ore balancing, ice balancing, uranium balancing).
By default inventories with the tag ‘Locked’, ‘Seat’ and ‘Control Station’ are excluded from sorting (the last two because they have no conveyor access). You can change or expand the list in the config section:
Exclude containers from item counting
You can exclude specific inventories from the item counting mechanism. This could be useful if you don’t want the autocrafting to see certain items in docked ships for example. Also, the inventory panels won’t show the items of that inventory either.
To do that, append the hiddenContainerKeyword to a blockname, by default ‘Hidden’. The list is also expandable if you want to exclude other blocknames by default:
Exclude grids from sorting
It is possible to exclude whole grids from sorting by either giving a connector on the grid running IIM or any connected grid’s connector the ‘[No Sorting]’ keyword. Every ship, vehicle or whatever, that docks to IIM’s grid’s connector, won’t be sorted (when having the tag on a ship, only the ship wearing it).
In this case, only sorting will be disabled. Special containers however are still filled and uranium and ice balancing is also active.
To completely ignore a grid, add the ‘[No IIM]’ keyword to a connector:
Every ship or other vehicle that docks to this connector won’t be sorted – all inventories, special containers, reactors and O2/H2 generators on that grid are completely ignored.
It is also possible to add the tags to a gridname directly (found in the info tab). That way, even rotor connected ships, drones or vehicles without a connector can be excluded..
Container priorities
By adding ‘[P#]’ to the container name, where # is a positive number between 0 and 2.1 billion, the container with the highest priority will always be filled first. Priorities are ordered in a way that P1 is the highest priority, P2 the next highest and so on.
Addtionally, there are two special priority tokens:
- ‘[PMax]’ this container has the highest priority and will always be filled FIRST
- ‘[PMin]’ this container has the lowest priority and will always be filled LAST
If a container is full, the container with the next highest priority gets filled and so on. Containers with no ‘[P#]’ tag have a very low priority that is generated by their entityID and is always above 10k.
Special containers however still have a higher priority than normal containers, but can also be tagged with priority tokens. The highest priority special container will be filled first.
Here are some examples of container names with priority numbers:
- Small Cargo Container 1 Ores [P1]
- Small Cargo Container [P13] Ingots
- [P5] Cargo Container Components
- Cargo Container Bottles [PMax]
Container balancing
It is possible to equalize the amount of every item in every container of a specific type. This leads to the same item set in all of your type containers. This is very useful if you are attacked and a container is destroyed – the other containers will still have all your items as a backup (if you planned your base well enough 😛 ).
This feature however is very instruction heavy and could crash the script if you have many containers of the same type (successfully tested it with 15 component containers). That’s why it’s turned off by default. Also, container priorites of the type containers won’t have any effect anymore.
To enable or disable the feature, change the respective setting in the config:
Auto assigning new containers
By default, new containers are assigned to be used by the script, when a container is full or no container of a specific type exists yet. Containers for tools, ammo and bottles are always assigned as one. The same applies to ingot and ore containers.
Another feature is the automatic unassignment of empty and thus unused type containers. The tag gets removed after a the container was empty for a while to free it up for other purposes. Containers with a priority token, like [P1] won’t ever be unassigned automatically.
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
Bottle refilling
By default, the script will try to move any incoming bottle to the first found tank that has the needed gas available or to a O2/H2 generator if there are no tanks or they are empty. After that, they get pushed to the bottle container. This works for just crafted bottles, that are inside an assembler, too. As scripts can’t read the bottle fill levels, the script will only move a bottle if it’s not in the bottles container already. So, if you want your bottle filled, store it in any other container, like some sort of untagged input container.
To enable or disable bottle filling, change the value in config section (heading “Sorting”) to true or false:
Fill level and no conveyor connection
By default, the script shows a fill level percentage at the end of cargo container names, it manages. It can also show a [No Conveyor] tag in the name, if the block has no access to your main cargo containers.
You can activate or deactivate these features in the script config by setting the value to true or false:
Internal inventory sorting
The internal inventory sorting sorts items in an inventory by name, amount or type. By default it is deactivated because it can lead to inventory desynchronization in multiplayer. Use at your own risk!
You can change the way, internal sorting works, by changing the sorting pattern in the config section:
You can also sort an individual inventory by changing the name of it. The syntax goes like this:
In this case, PATTERN is a combination of characters shown above. See the following block naming examples:
Sort an inventory by item amount, ascending (from lowest to highest):
Sort an inventory by type, descending (inverse alphabetical order Z -> A):
Sort an inventory by type and number of items, ascending (alphabetical order A -> Z, number of items from lowest to highest):
Special loadout containers
By naming a container with the special keyword (by default: ‘Special’), this container can be filled with a user defined set of items. To set the items, just edit the container’s custom data field (a list of items is generated there). Special containers will never be drained by the autosorting but they will be available for balancing methods like ice or uranium balancing and autocrafting.
Special containers have three modes:
- Positive numbers: stores the wanted amount and removes excess items (e.g.: Ore/Iron=100)
- Negative numbers: doesn’t store items but removes excess items (e.g.: Ore/Iron=-100)
- Keyword ‘all’: stores all items of that subtype like a type container (e.g.: Ore/Iron=all)
Negative numbers are great for blocks, that pull their items by themselves, like the nanite factory.. It limits the maximum amount that is allowed to stay in the factory.
The ‘all’ keyword is great for advanced sorting of items. It will store all items of that specific subtype in the container until it’s full. Excess items will then be stored in the regular type container.
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
Autocrafting
My script is able to autocraft your components using every assembler available on the grid. There is no need to assign specific assembler to specific components. The script splits the needed amount evenly between them.
To start off, you need to build an LCD and name it ‘LCD Autocrafting’. The script will put a list of components, that are autocraftable on the LCD. To set a new wanted amount, you simply have to edit the text on the LCD and change the number to your likings.
When the script queued items in the assemblers a symbol after the current amount will be shown, indicating, how many items are in the queue, e.g.: [Q:100]
By default, the assembler queue is sorted based on the most needed component. Whenever a component can’t be crafted, the script will move the item to the end of the queue so that other items can be crafted.
Enable autocrafting or autodisassembling by changing the following config settings. All assemblers will be used. Disassembling will disassemble everything above the wanted amounts. To use an assembler manually, add the manualMachineKeyword to it (by default: “!manual”)
A LCD with the keyword “Autocrafting” is required where you can set the wanted amount! This has multi LCD support. Just append numbers after the keyword, like: “LCD Autocrafting 1”, “LCD Autocrafting 2”, ..
If you want an assembler to only assemble or only disassemble, use the following keywords and append them to the assembler’s name.
A assembler without a keyword will do both tasks.
There are 5 modifiers that can be added to the wanted item amounts, that will change the way, autocrafting handles these items. These modifiers can be set on a per-item-level:
‘A’ – Assemble only
‘D’ – Disassemble only
‘P’ – Always queue first (priority)
‘H’ – Hide and manage in background
‘I’ – Hide and ignoren
Assemble only modifier
The script will assemble the item to the quantity you set but it will never disassemble it even is auto disassembling is turned on and the stored amount is greater than the wanted amount.
Usage:
Disassemble only modifier
The script will only disassemble the item, if it gets above the wanted quantity but it will never assemble more, if the stored amount drops below the wanted amount.
Usage:
Priority modifier
Whenever the stored amount of an item is not equal to the wanted amount of it, the script will move it to the front of the assembling queue (this was done with ‘!’ before v2.8.0)
Usage:
Hide and manage modifier
If you want autocrafting to manage the amount of an item but you don’t want it to be shown on the autocrafting LCD, you can use the ‘H’ modifier. The item with its current wanted amount will be moved to the custom data of your (first) autocrafting LCD and hidden from the LCD itself. The amount can be changed afterwards by editing it in the custom data. If you want to show it on the LCD again, just remove the line in the custom data.
Usage:
Hide and ignore modifier
If you want you want to hide an item from the autocrafting LCD and don’t want autocrafting to manage it, use the ‘I’ modifier (this was done with a negative item amount before v2.8.0). The item will be moved to the custom data of your (first) autocrafting LCD and hidden from the LCD itself. If you want to show it on the LCD again, just remove the line in the custom data.
Usage:
Modifiers are also combineable. ‘AP’ for example will assemble only and prioritize. ‘AD’ will basically just show the item on the LCD but neither assemble nor disassemble it.
Margins for assembling or disassembling items in percent based on the wanted amount (default: 0 = exact value).
Examples:
assembleMargin = 5 with a wanted amount of 100 items will only produce new items, if less than 95 are available.
disassembleMargin = 10 with a wanted amount of 1000 items will only disassemble items if more than 1100 are available.
You can add the header to every screen when using multiple autocrafting LCDs by enabling this option:
The assembler queue is by default sorted by the most needed components. So if your assembler is producing steel plates, interior plates and bulletproof glass and you’re absolutely dry on stell plates, they will be moved to the front of the queue.
The script is able to craft any modded item that is craftable in a vanilla assembler but it has to learn the crafting blueprint first. Unknown items have the tag [No BP!] (= no blueprint) behind their name:
In order to teach the script the blueprint of that item, you need to setup a learning assembler by adding one of the following tags to an assembler’s name:
!learn
This will learn one item and then remove the tag so that the assembler is part of the autocrafting again.
!learnMany
This will learn everything you queue in it and will never be part of the autorafting again until you remove the tag (Important note: only ever queue one itemstack at a time and wait for it to finish).
To learn an item, queue it up about 100 times (Shift+Klick) and wait until the script removes it from the queue:
The script links the blueprint to the resulting item and is now able to autocraft this item. You can check that the script has properly learned the blueprint if the [No BP!] tag is gone:
You can enable basic ingot crafting in survival Kits with this option. It will however be automatically disabled if you have regular refineries built.
Autocrafting is also possible with survival kits, but as they are very slow, they are deactivated as soon as you have regualar assemblers. If you still want to use them, change this value to false:
If you still want an assemblers to be manually controllable, you can add the keyword “!manual” to its name. With this keyword, it won’t be used by the autocrafting. The ouput of the assembler will still be sorted into your cargo containers. Example:
Auto disassembling
If you set up your autocrafting LCD already and set all your wanted amounts, you can enable automatic disassembling in your config section (heading Autocrafting). This feature will disassemble all your excess materials automatically using all available assemblers.
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
Please be sure to set your wanted amounts BEFORE your enable this feature as this will disassemble all your goods imediately and turn them back into ingots. Also, manual crafting is kind of limited after enabling this because the script always tries to keep the set amount of items on the autocrafting LCD at all times.
Assembler cleanup
This cleans up assemblers, if they have nothing to do and puts the contents back into a cargo container.
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
Refinery handling
This balances the ores in refineries. It’s designed to refine ores as fast as possible by splitting the ore amounts equally between the refineries. The script won’t care about the installed upgrades of a refinery, so if you want to refine a specific ore in a specific refinery, you might want to have a look at the topic “Special loadout containers”.
By default, ores are pulled based on the most needed ingots. Also the refinery queues are sorted by the most needed ingots. However, this only works with vanilla ores or modded ores, that only have one outcome, so something like the “Better Stone” mod, that yield multiple ingots per ore, is not fully supported. The script will use and refine these ores but not in an intelligent way.
If you want to exclude one specific refinery from ore balance, append the keyword ‘!manual’ to its name. Example:
By enabling ore balancing, the script will balance the ores between all refinieres so that every refinery has the same amount of ore in it.
Enable script assisted refinery filling? This will move in the most needed ore and will make room, if the refinery is already full
Also, the script puts as many ores into the refinery as possible and will pull ores even from other refineries if needed.
Sort the refinery queue based on the most needed ingots?
In the script config you can adjust, in which order ores are refined before the demand based refining is done. If you want an ore to always be refined first, simple remove the two // in front of the ore name to enable it. Enabled ores are refined in order from top to bottom so if you removed several // you can change the order by copying and pasting them inside the list. Just be careful to keep the syntax correct:
By default stone is enabled and will always be refined first.
Ice balancing
This will balance ice between all O2/H2 generators on all connected grids. By default, they are filled to a level, that 1 bottle still fits in there, which can be increased by modifying the ‘spaceForBottles’ variable (see below).
Note: O2/H2 generators will pull more ice automatically if you set a value below 60%
If you want to exclude one specific O2/H2 generator from ice balancing, append the keyword ‘!manual’ to its name. Example:
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
Uranium balancing
This will balance uranium between all reactors on all connected grids. The vanilla conveyor pull is deactivated in order to stop them from pulling more. A max uranium amount for large grid and small grid reactors can be set independently from each other.
If you want to exclude one specific reactor from uranium balance, append the keyword ‘!manual’ to its name. Example:
Change the values to ‘true’ or ‘false’ to activate or deactivate a certain feature:
LCD panel output
The following topic explains, how to use LCD panels (regular and block LCDs) of my script. Whenever you add one of the following keywords to a LCD name, the keyword gets transformed to the universal [IsyLCD] keyword. In the custom data, you can then set different options about the LCD as well as the screen, the information should be shown (on blocks like cockpits, programmable blocks and so on). The custom data will look like this:
@# KEYWORD
@# stands for the screen, the information is shown, where # is the screen identifier number from 0 to the max number of screens – 1. A programmable block for example has two screens: The main screen and the keyboard. Both can be used to show the script informations (screen 0 and screen 1). To change the screen, you want to show your informations, just edit the screen identifier number in the custom data.
It is also possible to display informations of different scripts in one block by using this syntax (MMaster’s Automatic LCDs 2 uses the same syntax and all of my other scripts).
Main LCD
You can display all the main script informations like type container fill levels, managed blocks and last script actions on the main LCD. Just add the following keyword to a LCD name:
IIM-main
You can enable or disable specific informations on the LCD by editing its custom data.
Warning LCD
You can display all current warnings and problems on a dedicated LCD screen. Just add the following keyword to a LCD name:
IIM-warnings
Performance LCD
You can display the script performance (PB terminal output) on a dedicated LCD screen. Just add the following keyword to a LCD name:
IIM-performance
Inventory items LCDs
You can show the current amounts of your stored items on LCD panels. To display them, build a LCD panel, add the keyword ‘IIM-inventory’ to its name and follow the on screen instructions:
1a. Either put a item type in the custom data:
1b. Or put a item subtype in the custom data:
1c. Or a combination of item type and subtype in the custom data:
1d. Or put a partial item name in the custom data:
1e. Or put one of the Echo commands in the custom data to show your own text or headings (v2.8.0+):
2. Optionally, add a max amount for the bars as a second parameter:
Example:
ingot 100000
Additional feature:
If an inventory panel line has 0 as the max value, a single line only containing the item name and current amount is shown (no bars, percentages or max values).
Example:
ingot 0
3. At last, you can add modifiers for each entry:
There are 5 modifiers at this point:
- ‘noHeading’ to hide the heading
- ‘singleLine’ to force one line per item
- ‘noBar’ to hide the bar
- ‘noScroll’ to prevent the text from scrolling
- ‘hideEmpty’ to hide items that have an amount of 0
Example:
Result:
Important!
Begin a new line for every item or every type you want to show on the LCD.
Hint:
One ‘noScroll’ modifier per screen is enough. It doesn’t need to be set for every custom data line.
The content of the LCD will adjust itself automatically to the set font size
You can display your inventory items over multiple screens by giving all screens the same group tag (this has to be set in the custom data of a screen after giving it the IIM-inventory tag in the name). The syntax is the following:
- GROUP is a name of your choice (NOT a terminal group!)
- # is the number of the LCD in the row
Example:
Custom data of LCD 1:
Custom data of LCD 2:
The settings of the first panel in the row will be set for all panels of the group (font size and custom data settings).
Note: Every panel’s name still has to contain the [IsyLCD] keyword in order to be recognized by the script (gets automatically set after giving the LCD the ‘IIM-inventory’ tag).
Commandline Arguments
Nearly every feature of the script can be temporarily enabled or disabled without the need to edit the script. These commands are sent to the script by writing them in the programmable block’s argument field and pressing run or by pulling the programmable block to any hotbar (cockpits, button panels and so on), selecting run and typing in the arguments in the popup window.
The syntax works like this:
For example:
This will temporarily disable autocrafting (until the script is recompiled or the world is reloaded).
This will toggle ore balancing on or off based on it’s current state.
This will delete all stored itemIds and blueprints. A recompile of the script is needed afterwards!