Merlin of Mines - Space Engineers

A set of useful scripts for aspiring Space Engineers!

View on GitHub

Laser Antenna Block Handler

This Block Handler handles laser antennas. There are separate block handlers for Beacons and Antennas.

Take special caution when trying to select Laser Antennas. It’s easy to misuse “Laser Antenna” as the selector will be “Antenna” unless you explicitly specify the block type:

#Interpreted as an Antenna
turn on "My Laser Antenna"
turn on "My Laser" antenna
turn on "My Laser Antenna" antenna

#Interpreted as a Laser Antenna
turn on "My Laser"
turn on "My LaserAntenna"
turn on "My Antenna Laser"
turn on "My Laser Antenna" laser
turn on "My Laser Antenna" laserAntenna

Default Primitive Properties:

“Enabled” Property

Enables or Disables the given block

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

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

“Power” Property

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

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

#Turn off
turn off "My Laser"
power off "My Laser"

“Target” Property

Gets or Sets the Target Coordinates for the Laser Antenna, i.e. where to point the laser antenna in order to communicate with another laser antenna.

Print "Target Coords: " + "My Laser" coordinates

#Obviously not a real coordinate, but you get the idea.
set "My Laser" target to "12.3:45.6:78.9"

“Radius” Property

Get/Sets the range of the laser antenna, in meters. So 2000 = 2000m = 2km

Print "Range: " + "My Laser" radius

set "My Laser" radius to 3000

“Range” Propertyw

Same as Radius. Get/Sets the range of the laser antenna, in meters. So 2000 = 2000m = 2km

Print "Range: " + "My Laser" range

set "My Laser" range to 3000

“Locked” Property

Get/Sets whether the laser is permanent, meaning the laser will automatically try to re-connect if/when a connection is lost.

if "My Laser" is locked
  Print "Connection is permanent"

lock "My Laser"

“Connected” Property

Get/Sets whether the laser is currently connected. When reading, will return whether the Laser’s status is Connected. When updating, will attempt to connect to the laser antenna’s target coordinates if the passed in Bool is true.

if "My Laser" is connected
  Print "Connection established"

#Attempt to connect to target coordinates.
connect "My Laser"