LUA events - LemADEC/WarpDrive GitHub Wiki

Introduction

This page documents events posted by WarpDrive blocks. Other events provided by ComputerCraft or OpenComputers blocks themselves will not be listed here. Please refer to their respective documentation for that. Sample are provided for ComputerCraft; OpenComputers adds an address parameter and a different syntax, check their documentation.

Ship controller

shipCoreCooldownDone

Sent when Ship core cooldown is finished, use it to trigger the next jump automatically.

-no parameters-

Enantiomorphic reactor

reactorActivation

Sent when reactor has been activated.

-no parameters-

reactorDeactivation

Sent when reactor has been deactivated.

-no parameters-

reactorPulse

Sent periodically when reactor simulation gets updated. Those are quite frequents, beware!

lastGenerationRate = os.pullEvent("reactorPulse")
  • lastGenerationRate is the energy increase since the last pulse.

Laser cannons

Those events apply to both Laser and Laser+Camera.

laserScanning

Sent when a block has been reached by a laser in scanning mode (i.e. with its beam frequency set to 1420).

local resultType, x, y, z, blockName, blockMetadata, blockResistance = os.pullEvent("laserScanning")
  • resultType should be BLOCK. Ignore the event otherwise.
  • x, y, z are the absolute block coordinates.
  • blockName is the unlocalized name of the block.
  • blockMetadata is the metadata for this block.
  • blockResistance is the blast resistance of this block so you can adjust your power.

laserSend

Sent when a laser has shoot at target. Use it to start to program the next fire.

local beamFrequency, beamEnergy = os.pullEvent("laserSend")
  • beamFrequency is the laser wavelength.
  • beamEnergy is the actual energy in that beam including boosters.

Transporter room

Those events apply to the Transporter Core.

transporterPulse

Sent periodically when lock strength gets updated. Those are quite frequents, beware!

lockStrength = os.pullEvent("transporterPulse")
  • lockStrength is the actual locking strength from 0.0 to 1.0 or higher.

transporterEnergizing

Sent when starting to energize the Kelaptron flux beams.

countEntities = os.pullEvent("transporterEnergizing")
  • countEntities is the number of active beams.

transporterFailure

Sent for each Kelaptron flux beam failing to transport an entity.

nameEntity = os.pullEvent("transporterFailure")
  • nameEntity is the name of the entity that couldn't be teleported.

transporterSuccess

Sent for each Kelaptron flux beam transporting an entity.

nameEntity = os.pullEvent("transporterSuccess")
  • nameEntity is the name of the entity that could be teleported.