Space Engineers

Space Engineers

815 个评价
Nanobot Build and Repair System Queuing / Display / Scripting
3
5
4
2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
71.322 KB
2017 年 2 月 19 日 上午 10:43
2019 年 9 月 21 日 上午 5:25
11 项改动说明 ( 查看 )

订阅以下载
Nanobot Build and Repair System Queuing / Display / Scripting

描述
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.
热门讨论 查看全部(6)
6
1 月 7 日 下午 6:45
The text panel wont display anything, just says Online
tR02020
1
2024 年 8 月 29 日 下午 10:40
exception during execution of script:Invalid property at RepairSystemHandler.get_CurrentTarget()
Atreyu Wolfson
4
2023 年 2 月 10 日 下午 8:51
Code Examples
Dummy08
329 条留言
Harry Spotter 10 月 12 日 上午 5:45 
DOesnt work anymore, any updated version ?
Red_Fog 10 月 11 日 下午 6:37 
Is their a updated script for this mod or only the maintained varient?
Keienmahazli 9 月 22 日 上午 6:51 
Nanobot Build and Repair System Queuing / Display / Scripting (Maintained)

Try this one
Roboman5e15YT 9 月 14 日 上午 1:11 
im getting an error after the Apex Update of:

BaR Group 0(08/25/2025 03:07:18):
Caught exception during execution of
Script: Property
BuildAndRepair.MissingComponents is not of type
Memory SafeDictionary 2, correct type is Dictionary 2 at
Sandbax.ModAPI.Interfaces.TerminalPro
pertyExtensions.CastTValue (TerminalProperty
property)

at
Program.RepairSystemHandler.MissingC
amponents()
at
Program.BuildAndRepairSystemQueuing GraupData.CheckAssemblerQueues()
at
Program.BuildAndRepairAutoQueuing.Ch
eckAssemblerQueues()
at
Program.BuildAndRepairAutoQueuing.Handle()
at
Program.Main(Stringarg)
at
Sandbox.Game.Entities.Blocks.MyprogrammableBlock.<>c__DisplayClass46_0.<ExecuteCode>b__0(IMyGridProgramprogram)
at
Sandbax.Game.Entities.Blocks.MyProgra mmableBlock.RunSandbaxedPragramAct
lonDore(Action'
action, String &
response)
LegendaryLoser2010 8 月 25 日 上午 1:18 
Hey, I’m coming up with some odd bug that follows:

BaR Group 0(08/25/2025 03:07:18):
Caught exception during execution of
Script: Property
BuildAndRepair.MissingComponents is not of type
Memory SafeDictionary 2, correct type is Dictionary 2 at
Sandbax.ModAPI.Interfaces.TerminalPro
pertyExtensions.CastTValue (TerminalProperty
property)

at
Program.RepairSystemHandler.MissingC
amponents()
at
Program.BuildAndRepairSystemQueuing GraupData.CheckAssemblerQueues()
at
Program.BuildAndRepairAutoQueuing.Ch
eckAssemblerQueues()
at
Program.BuildAndRepairAutoQueuing.Handle()
at
Program.Main(Stringarg)
at
Sandbox.Game.Entities.Blocks.MyprogrammableBlock.<>c__DisplayClass46_0.<ExecuteCode>b__0(IMyGridProgramprogram)
at
Sandbax.Game.Entities.Blocks.MyProgra mmableBlock.RunSandbaxedPragramAct
lonDore(Action'
action, String &
response)

What am I missing?
SKO85 4 月 29 日 上午 6:00 
Fixed version of the script for Nanobot Build and Repair:
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3472701905
SKO85 4 月 29 日 上午 3:39 
I will try fix it and upload a maintained version as Dummy08 has not been reacting over several years.
Max Warden 4 月 29 日 上午 3:08 
o7
Static 4 月 29 日 上午 1:36 
After 6 Years, they finally broke the script; Hope Summy08 can fix and update it
Keienmahazli 4 月 29 日 上午 12:16 
Same here to