Script Options
The script contains the following configurable variables/functions to adapt the script to your ship configuration or needs:
DISPLAY_TAG
Type: string
Current Default Value:
"CargoManagerDisplay"
Any LCD panel with this in its name is overridden to show status.
EJECTION_GROUP
Type: string
Current Default Value:
"Excess Cargo Ejection"
The group with all collectors/ejectors which are set to eject their contents.
ENABLE_ORE_SORTING
Type: bool
Current Default Value:
true
Whether ore should be sorted automatically between refinery types; useful if you have mods for specialized processing.
MOVE_FROM_SMALL_TO_LARGE
Type: bool
Current Default Value:
true
Whether items should be moved from small to large containers if possible.
SKIP_OFFLINE_REFINERIES
Type: bool
Current Default Value:
true
Whether offline refineries should be ignored for the purposes of ore routing; this allows choosing between either holding onto the ore until a "better" refinery is available or ignoring those refineries and just using the most applicable enabled one.
ENABLE_O2_GENS
Type: bool
Current Default Value:
false
Whether offline O2/H2 generators should be ignored, vs turned on as long as there is work for them.
EJECT_OVERFULL_ITEMS
Type: string[]
Current Default Value:
{"ore/stone", "ingot/stone"}
Which items to eject if they get too full. Empty list for none.
EJECTION_THRESHOLD
Type: float
Current Default Value:
0.9F
To be ejected, the cargo space must be at least this fraction full, and the item must represent at least this fraction of all stored items.
ORE_PRIORITY
Type: string[]
Current Default Value:
{"Iron/50000", "Nickel/10000", "Silicon/5000", "Cobalt/2500", "Silver/1000", "Gold/200"}
Ore types and the ingot threshold at which they are given priority (ie if you have less than this amount of refined metal). If multiple "priority" ores are applicable, the ordering of this list determines priority among them.
SORTING
Type: string[]
Current Default Value:
{""}
Which item types to sort, and where. Empty list for none.
NO_PROCESS
Type: string[]
Current Default Value:
{}
Ores to keep as ore, preventing any processing. Useful if this script is running on a mining ship and needs to cart the ore back to base for specialized processing.
isActualProcessingRefinery(string name)
Return Type: bool
Current Default Code:
return !name.Contains("shieldgenerator"); //Shields ignored by default
Some mods use blocks which are refineries internally, but have no cargo handling nor ore processing. Use this to filter them out.
cargoBoxSortOrder(IMyCargoContainer box1, IMyCargoContainer box2)
Return Type: int
Current Default Code:
return box1.CustomName.CompareTo(box2.CustomName); //Default string comparison on their terminal names, which will end up being based on their autogenned numbers
Standard Java/C# Comparator format, used to determine the sorting order of cargo containers, and thus filling priority.
isItemValidForContainer(string itemCategory, string itemType, string containerName)
Return Type: bool
Current Default Code:
return true;
Whether the given cargo container can accept this item when emptied from other locations. This allows item-type-specific sorting.
isSharedGrid(string name)
Return Type: bool
Current Default Code:
return false;
Whether cargo, refineries, etc on this grid should be counted as part of the main grid.
shutdownWhenDockedTo(string connector, string other, string grid)
Return Type: bool
Current Default Code:
return false;
Whether to pause all execution when the given connector is connected to the given grid by the given other connector, perhaps so its copy of this script can take precedence.
Source Code
The source code for Refinery and Cargo Manager can be found here:
GitHub