Merlin of Mines - Space Engineers

A set of useful scripts for aspiring Space Engineers!

View on GitHub

Sensor Block Handler

This Block Handles Sensors, which you can use to automatically do things when you detect entities.

Default Primitive Properties:

“Enabled” Property

Enables or Disables the given block

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

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

“Power” Property

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

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

#Turn off
turn off "My Sensor"
power off "My Sensor"

“Trigger” Property

Returns whether the Sensor is currently detecting an entity.

if "My Sensor" is triggered
  Print "Gotcha!"

“Silence” Property

Gets/Sets whether the sensor will play an audible beep when an entity is detected.

if "My Sensor" is silent
  Print `I see you but you can't hear me`

silence "My Sensor"

“Target” Property

Gets whether the sensor’s current target. When getting, will return either the manually set target, or the position of the targeted entity. If the sensor has not detected anything, it will return 0:0:0.

Print "Target Location: " + "My Sensor" target

“Target Velocity” Property

Gets the velocity of the sensor’s last detected entity, in world coordinates. If the sensor has no detected entity, it will return 0:0:0.

Print "Target Velocity: " + "My Sensor" target velocity