Space Engineers

Space Engineers

785 ratings
Nanobot Build and Repair System Queuing / Display / Scripting
3
4
4
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
71.322 KB
Feb 19, 2017 @ 10:43am
Sep 21, 2019 @ 5:25am
11 Change Notes ( view )

Subscribe to download
Nanobot Build and Repair System Queuing / Display / Scripting

Description
Full automatic queuing of missing materials and displaying block status on panel(s)
This is a simple out of the box script, to be used with the Nanobot Build and Repair System Block.
For details see Nanobot Build and Repair System.
!! This script is designed to work with this block only !!

Using this script will enable full automatic queuing of missing materials into the configured assemblers.
Optional you could also configure the script to show status information about the BaR-Systems at one or multiple text panels.

How it works
Put the script into a programmable block.
To configure the scipt itself you have two options:

  1. Putting all build and repair systems (that should be able to queue) into a group named "BuildAndRepairGroup1", and put all assemblers that should use for queuing into a second group called "AssemblerGroup1", if you like to display some status information on a panel, just place a text panel and name it "BuildAndRepairGroup1StatusPanel" and that's it.

  2. For more complex scenarios, where you have two or more groups of build and repair systems that work independently, you have the option to define as many groups as you need.

    At the top of the script you will find a static array called:
    BuildAndRepairSystemQueuingGroups, where you can put your groups in.
    Every group is an entry of the type BuildAndRepairSystemQueuingGroup
    Every group has four properties:
    • BuildAndRepairSystemGroupName: The name of a group containing Build and Repair Systems
    • BuildAndRepairSystemNames: A list of names of individual Build and Repair Systems
    • AssemblerGroupName: The name of a group containing assemblers
    • AssemblerNames: A list of names of individual assemblers
    • DisplayNames: A list of names of text panels where the system info should be displayed (Empty if no panels should be used)
    • DisplayKinds:A list that defines the information that should be alternating displayed. You could choose out of these informations ( DisplayKind.Status, DisplayKind.ShortStatus, DisplayKind.MissingItems, DisplayKind.WeldTargets, DisplayKind.GrindTargets, DisplayKind.CollectTargets )
    • DisplayMaxLines: Defines the items that should be displayed in case of listings 'Missing items', 'WeldTargets', ..
    • DisplaySwitchTime: Time in seconds after that the next information page is displayed. (If "DisplayKinds" has only on element this value is ignored)

    You could use every combination of the four properties to discribe your logical group. So for e.g. if you define a "BuildAndRepairSystemGroupName" and a list of "BuildAndRepairSystemNames" names. In the end the script will internally manage a combined list of every system in the group plus the individual given systems. The same applies for the assembler properties.

    So lets make an example:

    You have 2 logical groups of repair systems. Lets say one works in the hangar bay1 and the other in hangar bay2. So you define four groups "Hangar1BaRSystems"/"Hangar1Assemblers" and "Hangar2BaRSystems"/"Hangar2Assemblers".
    In that case your configuration will look like:
    static BuildAndRepairSystemQueuingGroup[] BuildAndRepairSystemQueuingGroups = { new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemGroupName = "Hangar1BaRSystems", AssemblerGroupName = "Hangar1Assemblers" }, new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemGroupName = "Hangar2BaRSystems", AssemblerGroupName = "Hangar2Assemblers" } };

    If you decide to put individual system names into the script it could look like:
    static BuildAndRepairSystemQueuingGroup[] BuildAndRepairSystemQueuingGroups = { new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemNames = new[] { "Hangar1BaRSystem1", "Hangar1BaRSystem2" }, AssemblerNames = new[] { "Hangar1Assembler1", "Hangar1Assembler2" } }, new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemNames = new[] { "Hangar2BaRSystem1", "Hangar2BaRSystem2" }, AssemblerNames = new[] { "Hangar2Assembler1", "Hangar2Assembler2" } } };

    As sayed before you could mix both methodes as you like:
    static BuildAndRepairSystemQueuingGroup[] BuildAndRepairSystemQueuingGroups = { new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemGroupName = "Hangar1BaRSystems", AssemblerGroupName = "Hangar1Assemblers" AssemblerNames = new[] { "Hangar1AssemblerReserve1" } }, new BuildAndRepairSystemQueuingGroup() { BuildAndRepairSystemGroupName = "Hangar2BaRSystems", BuildAndRepairSystemNames = new[] { "Hangar2BaRSystemOptional1" }, AssemblerGroupName = "Hangar2Assemblers" } };

If you define an emtpy group, or none block of the right type there will be an error message displayed in the detail section of the programmable block.

Further the script refreshes the given groups every 2 minutes, so if you put a new block inside a group, it will be detected latest after 2 minutes. If you don't whant to wait, you could go to the programmable block, open and close the editor, this will force the detection immediately.


Feel free to use this script in your own designs.

  • If you like to use the block in your own scripts, the class RepairSystemHandler encapsulates all the functions the block offers and is designed to handle one or a list of systems to be used parallel. (In order to use the class you need also the base classes EntityHandler and EntityHandler<T>)


Have fun.
Popular Discussions View All (6)
6
Jan 7 @ 6:45pm
The text panel wont display anything, just says Online
tR02020
1
Aug 29, 2024 @ 10:40pm
exception during execution of script:Invalid property at RepairSystemHandler.get_CurrentTarget()
Atreyu Wolfson
4
Feb 10, 2023 @ 8:51pm
Code Examples
Dummy08
314 Comments
TechCoder Jan 27 @ 3:52am 
You really don't need to know how many of each item to make - that is what this script does for you.

THE BASICS
Scroll through the code and look for these three lines (if you haven't made any changes to the code, this is likely where your issue is)

BuildAndRepairSystemGroupName = "USETHISNAMEONBARGROUP",
AssemblerGroupName = "USETHISNAMEONASSEMBLERGROUP",
DisplayNames = new [] { "USETHISNAMEONLCD", "Cockpit[0]" },

Use the name in the associated lines (they are not together, but they are the important ones) to make a Group with all the BARs that you want to use in this, another Group for the Assemblers and an LCD for the Display.

That is IT - no need for anything else (unless you have a huge base and/or want to get fancy)

But, you MUST set at least the BAR and Assembler Groups or "the script won't work" (because YOU didn't tell it what it can use!)
wolfcamaro53196 Jan 26 @ 9:35pm 
ok maybe im stupid but i need help trying to figure out how to show the queue of how many of each item to make on a LCD cause i just cant seem to get it to work for me
Alcatraz Dec 5, 2024 @ 3:22am 
I can say it works fine. When I got something not seeing in my LCD's, or not queuing it is because of ME. Not grouped, not writed correctly, using strange caracters in the names (I'm Spanish and use to use the accents for every word it has 'em).

1 - Name as simply as you can.
2 - Review all names into the script and make SURE you put them in the right place.

I'm not a programmer at all, and had to spent couple of hours at least figuring out how to make my LCD's not show ALL the vast info, just what I wanted.

(((Sorry, Steam limit to 1000 characters 😢)))
Alcatraz Dec 5, 2024 @ 3:21am 
Leave example here of the first part of the script (names are in Spanish most of them use the Google Translator xD):

static BuildAndRepairSystemQueuingGroup[] BuildAndRepairSystemQueuingGroups = {
new BuildAndRepairSystemQueuingGroup() {
BuildAndRepairSystemGroupName = "BaR System Base Earth",
AssemblerGroupName = "Ensambladores",
Displays = new [] {
new DisplayDefinition {
DisplayNames = new [] { "LCD BaR System 01", "Cockpit[0]" },
DisplayKinds = new [] { DisplayKind.ShortStatus},
DisplayMaxLines = 19,
DisplaySwitchTime = 4
} ,
Alcatraz Dec 5, 2024 @ 3:21am 
new DisplayDefinition {
DisplayNames = new [] { "LCD BaR System 02", "Cockpit[0]" },
DisplayKinds = new [] {DisplayKind.WeldTargets, DisplayKind.MissingItems },
DisplayMaxLines = 19,
DisplaySwitchTime = 4
} ,
new DisplayDefinition {
DisplayNames = new [] { "LCD BaR System 03", "Cockpit[0]" },
DisplayKinds = new [] { DisplayKind.MissingItems },
DisplayMaxLines = 19,
DisplaySwitchTime = 4
}
}
}
};
TechCoder Dec 1, 2024 @ 12:39pm 
"broken and not working" - wow, that is descriptive and helpful to have someone help you (NOT)
and certainly not the experience of those of us that use it all the time.
Amaia Nov 30, 2024 @ 12:51am 
Yaa, this script is currently broken and not working :(
Frogmaster Nov 24, 2024 @ 6:49am 
Me love you, :) This saves me soooo much time! thank you for creating it.:steamhappy:
TechCoder Nov 15, 2024 @ 3:44am 
@Smackhead Steve - sounds like you don't have scripting allowed in the world.
I did a fast search online and found https://www.youtube.com/watch?v=E_vco_MXSfQ - probably help you get going.
Smackhead Steve Nov 14, 2024 @ 1:34pm 
so i subbed to this so i can have my assemblers auto Q the materials for blueprints, but the script isn't showing up when i go to "edit settings" and "mods" then click the "scripts" area. Also just watched a video tutorial, and on the video tutorial he says "go to the programmable block, and click edit..." but mine just has "customize" no edit, no script, nothing. What am I missing?