Space Engineers

Space Engineers

45 ratings
Automated Assembler
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
453.559 KB
22 Sep, 2016 @ 2:24pm
14 Jan, 2021 @ 11:26am
19 Change Notes ( view )

Subscribe to download
Automated Assembler

Description
This in-game script automatically assemble components up to a quota using just one assembler (or more if you prefer).

To use this place it in a programming block. Add [AUTOMATIC] to all the assemblers you would like it to control.
NO LONGER REQUIRES A TIMER!

You can tag an (optional, one or more) LCDs with [AUTOMATIC] and status information will be written to it's public text.

You can also add commands (one per line) to the "Custom Data" of either the LCD (if present) or the program block itself (or both). The following commands are recognised:
  • Change the tag to search for from "[AUTOMATIC]" to something else:
    "tag" newtag
    Note that newtag should include "[" and "]" if you want to match them.
  • Control which surface(s) to put status on:
    "surface" surface_number_or_name enable
    enable should be "true" or "false". This command must be set in the "Custom Data" of the block it applies to! Surface numbers start at 0 and names should be the same as in the space engineers UI or will be displayed in debugging output if "debug" is enabled. Example:
    surface Large Display true
  • Map a component to its blueprint name:
    "component" shortname blueprintid
    Use "showcomponents" for example usage.
  • Set the recipe for one component:
    "recipe" component ingot:quantity,ingot:quantity,...
  • Set the quota for one component:
    "quota" component quantity
  • Set the same quota for all known components:
    "quota *" quantity
  • Print all quotas to the LCDs in a form that can be copied to the "Custom Data".
    "showquotas"
  • Print all components to the LCDs in a form that can be copied to the "Custom Data".
    "showcomponents"
  • Print all recipes to the LCDs in a form that can be copied to the "Custom Data".
    "showrecipes"
  • Set quotas in a block
    "begin quota"
    component quantity
    ...
    "end quota"
    Note that there is no "*" component in this form.
  • Set components in a block
    "begin components"
    shortname blueprintid
    ...
    "end components"
  • Set recipe in a block
    "begin recipe"
    component ingot:quantity,ingot:quantity,...
    ...
    "end recipe"
  • Import quotas from "MMaster's Automatic LCDs"
    "import lcd" lcdname
    This can match multiple lcds and they will be treated as one. Useful for !LINK lcds. It searches for the output of "Inventory * +component" style lines.
  • Control if components that are discovered are added to the programming block's "Custom Data" (default)
    "addlearned"
  • Disable adding learned components to "Custom Data"
    "no addlearned"
  • Only search the current grid for inventories
    "thisgrid"
  • Search all connected grids for inventories (default)
    "no thisgrid"
  • Map a name displayed in an imported LCD to a real quota entry
    "alias" lcdstyle quotastyle
  • Only queue this factor of items relative to the amount required(default = 1.0)
    "factor" multiplier
  • Only queue this maximum number of each type of item (default = unlimited)
    "maxqueue" maximum
  • Disable any factor and queue the required number of items
    "no factor"
  • Disable the queue limits
    "no maxqueue"

It will work with (but not directly manage) "coop" assemblers (don't tag them).

Example "Custom Data":
# Set the tag: tag [Managed Assemblers] # Configure a custom component: component "AdvancedPowerCell" "MyObjectBuilder_BlueprintDefinition/AdvancedPowerCell" recipe "AdvancedPowerCell" Iron:1,Silicon:1,Nickel:0.40,Silver:0.20,Gold:0.50,Platinum:0.05 # Set the quota for all known items to 100: quota * 100 # This is actually already built in: alias "Bulletp. Glass" "BulletproofGlass" # Import quotas from "MMaster's Automatic LCDs" with the !LINK:INVENTORY tag: import lcd !LINK:INVENTORY # Set the quota for SteelPlate to 1000: quota SteelPlate 1000

Known issues that I plan to address:
  • Currently quota is set at the top of the script.
  • The assembler tag name is not configurable.
  • It will not build items you don't have any of. (this is intentional but will likely go when quota handling is improved).
  • It will not consider ingots that are required. Unless you define recipes.
  • It will duplicate work if multiple assemblers are specified (shouldn't normally be an issue - you may get a few extra of each component).
  • It can't import quotas from "Taleden's Inventory Manager" nor "MMaster's Automatic LCDs".
  • It can't export quotas to "Taleden's Inventory Manager" nor "MMaster's Automatic LCDs".
75 Comments
spidererrol  [author] 14 Jan @ 2:17pm 
Unfortunately that probably means that this script no longer works with current versions of space engineers. As mentioned below I am not in a position to fix it, so I'm afraid you'll have to look elsewhere.
Papuchovsky 14 Jan @ 1:41pm 
Hello! I'm not a Dev, I tried to use this scrip but pops up this message:

Program(283,16): Warning: The member 'Program.?.(string,string,string)' does not hide an accessible member. The new keyword is not required.

But don't know what that means
spidererrol  [author] 3 Sep, 2023 @ 3:01pm 
Unfortunately my dev environment for this is broken and I don't have time to play Space Engineers currently, so this script is unlikely to be fixed by me.
I've published the source code (along with multiple other scripts) to github [github.com] should anyone else fancy trying it, you are welcome to fork your own versions.
CraegTheRed 3 Sep, 2023 @ 2:07pm 
Useful Script, thanks
Looks like the latest update messed something up. When it tries to queue canvas (which has been moved to a new category in the assembler) I get an exception object reference not set to instance of object at Sandbox.Game.Entity.Cube.MyProductionBlock.AddQueueItemRequest(MyBlueprintDefinitionBase blueprint, MyFixedPoint ammount, Int32 idx)
LS 12 Jan, 2023 @ 2:20am 
Very nice script!
The ammo added in the Warfare2 UPDATE (ex.ArtilleryShells) can now be produced by updating the Dictionary at the beginning of the script, but the "NO QUOTA FOR:" displayed in the "showquotas" command is not reflected.
This is not a practical problem, but is there any way to solve it? It is difficult for me to read the script.
Vindros 17 Oct, 2022 @ 10:49am 
Can you give the Custom Data instruction for Artillery Shells and Assault Cannon shells ? I set the default to be 0 for everything and am only defining explicit items I want to keep up to date - many thanks ! Wish I had found this sooner, it makes large scale building much easier -
Jimmy Carter 31 Mar, 2022 @ 10:57am 
Hi Spiderrerrol, I tried your script but when I load the script and setup the assembler, the script loads the assembler que with components that I did not "order". How tell the script to not do this?
[Andon] 8 Apr, 2021 @ 3:14pm 
Cool! No worries about a quick fix, I know these things take time.
spidererrol  [author] 8 Apr, 2021 @ 1:32am 
[Andon] I believe I understand the problem now, however I don't have a quick fix and unfortunately I will not be able to try anything for at least a couple of weeks. For now, only components and ammo are supported.
[Andon] 5 Apr, 2021 @ 10:10am 
A welder is produced by an assembler; a welder is not a component. According to the game it's a PhysicalGunObject.

The program had no issues producing a welder, but it doesn't find any welders because if it's looking for a welder *component* it won't.

If the custom data is as follows, it will produce welders until it runs out of materials:

quota * 0
component "WelderItem" "MyObjectBuilder_BlueprintDefinition/Welder"
quota WelderItem 4

Even changing it to PhysicalGunObject instead of Component doesn't change anything, it just. Produces welders forever.

It's not a problem with it recognizing the blueprints - it does that just fine. It's a problem with seeing how many of the (non-component) object are already in cargo.