Merlin of Mines - Space Engineers

A set of useful scripts for aspiring Space Engineers!

View on GitHub

Connector Block Handler

This Block Handler handles Connectors, which allow you to automatically connect and disconnect grids together.

Default Primitive Properties:

“Enabled” Property

Enables or Disables the given block

#Enable Block
enable "My Connector"
set "My Connector" to enabled
turn on "My Connector"

#Disable Block
disable "My Connector"
set "My Connector" to disabled
turn off "My Connector"

“Power” Property

Turns on or off power to the block. Effectively the same as the Enabled property.

#Turn on
turn on power to "My Connector"
power on "My Connector"

#Turn off
turn off "My Connector"
power off "My Connector"

“Connect” Property

Gets/Sets whether the connector is connected. A connector is connected if it’s Connector status is “Connected”.

When setting the property, the connector will attempt to connect or disconnect, depending on if the supplied value is true/false, respectively.

The connector only attempts to connect/disconnect once. It does not continue to attempt, or wait for a connection/disconnection. However, you can use a conditional check to continually attempt to connect/disconnect.

if "My Connector" is connected
  Print "I am connected!"

#Try to connect until connected
until "My Connector" is connected
  connect "My Connector"

#Disconnect
disconnect "My Connector"

“Locked” Property

Identical to the Connect Property

“Ready” Property

Returns true if the connector is ready to connect, false if already connected or not ready to connect.

if "My Connector" is ready
  Print "Ready to Connect!"

“Ready Connect” Property

Same as Ready. Returns true if the connector is ready to connect, false if already connected or not ready to connect.

if "My Connector" is ready to connect
  Print "Ready to Connect!"

“Ready Lock” Property

Same as Ready. Returns true if the connector is ready to connect, false if already connected or not ready to connect.

if "My Connector" is ready to lock
  Print "Ready to Connect!"

“Strength” Property

Gets/Sets the strength of the Connector, as a percentage between 0 and 1 (representing 0% and 100%). The Connector strength determines how hard the connector pulls on other connectors in proximity in order to connect.

“Drain” Property

Gets/Sets whether the connector is throwing out items (acting like an ejector).

if "My Connector" is draining
  Print "Throwing out the garbage"

tell "My Connector" to drain
drain "My Connector"

“Collect” Property

Gets/Sets whether the connector is automatically pulling items from connected inventories (acting like a Sorter, but without a filter).

if "My Connector" is collecting
  Print "Grabbing all the items."

tell "My Connector" to gather
tell "My Connector" to stop collecting