Space Engineers

Space Engineers

743 ratings
Nanobot Build and Repair System Queuing / Display / Scripting
2
4
2
3
   
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 (5)
5
Apr 28 @ 4:00am
The text panel wont display anything, just says Online
tR02020
4
Feb 10, 2023 @ 8:51pm
Code Examples
Dummy08
0
Dec 29, 2023 @ 4:55am
Fehler
Odin23x
295 Comments
Coeptis87 May 5 @ 2:26pm 
im getting a bunch of errors in the PB lol

"Caught exception during execution of script:Invalid property at Sandbox.MODAPI.Interfaces.TerminPropertyExtensions.CastTValue(ITerminalProperty)

and a bunch more for IMyTerminalBlock etc..
Pixiu May 2 @ 7:08am 
Same with me. The errors started showing up last few days. I hope it gets fixed. This is such a useful script!
Vorg Apr 20 @ 3:52pm 
I am also getting exception errors. Been told it's broken by SE updates
OwenForce Apr 13 @ 7:18pm 
Is anyone else getting this error in client side log when trying to use this script on a dedicated server?

MOD_CRITICAL_ERROR: Nanobot Build and Repair System Queuing / Display / Scripting
2024-04-13 19:54:43.114 - Thread: 1 -> in file: Unknown
2024-04-13 19:54:43.114 - Thread: 1 -> MOD PARTIALLY SKIPPED, LOADED ONLY 1/6 PHASES, Following Error occured:
Object reference not set to an instance of an object.
Sandbox.Game
at Sandbox.Definitions.MyDefinitionManager.LoadDefinitions(List`1 contexts, List`1 definitionSets, Boolean failOnDebug, Boolean isPreload)
Chrysaloid Feb 15 @ 7:30pm 
Same as previous person - everything works fine.
One issue though: what is the best way to handle expansion of the base? So far I was manually setting up all new B&R blocks and then adding them to the group. It is becoming quite tedious and I'm wondering if there is some simpler method.
Thelios Feb 7 @ 3:30pm 
Seems like everybody is reporting this as broken, but it works perfectly fine for me.

Maybe there's some obscure mod conflict or it's being set up incorrectly. Either way, I configured it as described in the description and it works flawlessly.
lowww Feb 1 @ 10:11am 
I replaced groups by:
BuildAndRepairSystems-[LOASC1]
Assemblers-all-[LOASC1]
I checked that all BuildAndRepairSystems are managed by the script.
After script compilation I could not change colour by middle mouse click anymore.
Application restart. I could change colour by middle mouse click.
I switched the script on. BuildAndRepairSystems stopped work.
I unchecked that all BuildAndRepairSystems are managed by the script. BuildAndRepairSystems started work.
I could not build any new block by left mouse click after that :(
Application restart. I could build a new block by left mouse click.
P.S. Display works in cockpit as expected.
hugums247 Dec 31, 2023 @ 11:31am 
I have everything set correct (I hope) and they do nothing . Script shows blocks to grind, And bots wont go.
Zicarius Dec 1, 2023 @ 7:57am 
@Reece i just subscribed now, and go to my Programmable Block, then refresh it. Searches it, Build, then it shows
Reece Dec 1, 2023 @ 3:14am 
Is this mod still working? For some reason, it doesn't show up in my "script" list when going into the Programmable block.

I'm not sure if it's supposed to appear as a "mod" in the mods list when loading the game, but nothing is there either. I've double checked that it's installed, built a new block afterwards to no avail. Any advice please?