-
Notifications
You must be signed in to change notification settings - Fork 41
LUA API
Most machines in the mod are provided 'as is' with a limited user interface. It's up to you to program and interconnect them to make the most of it. To this effect, an extensive API is provided for use in your ComputerCraft or OpenComputers LUA scripts.
Basic programs are provided with most blocks, they're usually more up-to-date than this wiki, so you might want to start there. As a server/modpack owner, you may disable the default scripts and provide them through other means like a floppy, check the mod's configuration.
Warning: method and properties written in italic* are deprecated and subject to change.
All machine names on the network are prefix with the mod name 'warpdrive'. Here's a non-exhaustive list of those names:
warpdriveAccelerator
warpdriveAcceleratorControlPoint
warpdriveAirGenerator
warpdriveCamera
warpdriveChunkloader (not documented yet)
warpdriveCloakingCore
warpdriveEnanReactorCore
warpdriveEnanReactorLaser
warpdriveEnergyBank
warpdriveForceFieldProjector
warpdriveForceFieldRelay
warpdriveLaser (not documented yet)
warpdriveLaserCamera
warpdriveLaserTreeFarm
warpdriveLift
warpdriveMiningLaser
warpdriveMonitor
warpdriveLaserMedium
warpdriveParticlesInjector
warpdriveRadar
warpdriveShipController (not documented yet)
warpdriveShipCore
warpdriveShipScanner
warpdriveTransporterBeacon
warpdriveTransporterCore
warpdriveWeaponController (no API)
The following table gives you which method is available for each block. You may refer to the LUA methods page for details.
Functional methods | Description | Machines |
---|---|---|
energy | Return the current and max energy | All energy blocks |
state | Return the current state of the machine | Mining laser, Laser tree farm, Scanner |
start | Start a new operation | Mining laser, Laser tree farm |
stop | Stop the current operation | Mining laser, Laser tree farm |
laserMediumDirection | Returns medium direction | Mining laser, Laser tree farm |
laserMediumCount | Returns number of medium connected | Mining laser, Laser tree farm |
isAssemblyValid* | Return whether cloaking multiblock is valid | Cloaking device |
getResultsCount | Return the number of results | Radar |
getResult | Return one of the result | Radar |
energy | Returns energy, max energy, energy rate | Enantiomorphic reactor core |
instability | Returns the 4 instability values (100 is the point when the reactor explodes) | Enantiomorphic reactor core |
release | Sets the reactor to output all energy or disables outputting of energy | Enantiomorphic reactor core |
releaseRate | Releases at most that much energy per tick | Enantiomorphic reactor core |
releaseAbove | Releases any energy above arg0 amount | Enantiomorphic reactor core |
hasReactor | Returns true if the laser can see a reactor and false otherwise | Enantiomorphic reactor laser |
side | Returns 0-3 depending on which side of the reactor its on | Enantiomorphic reactor laser |
sendLaser | Sends a laser of that much energy to stabilize the reactor | Enantiomorphic reactor laser |
scan* | Create a schematic from a ship | Scanner |
fileName* | Return the schematic filename | Scanner |
deploy* | Build a ship from a schematic | Scanner |
The following table gives you which property get/set methods are available for each block. You may refer to the LUA properties page for details.
Get/set method | Type | Default value | Range | Machines |
---|---|---|---|---|
enable | boolean | false | - | Cloaking core |
offset | Number | 1 | 1 to 255 | Mining laser |
radius | Number x Number | 8 x 8 | 3 to 16 | Laser tree farm |
tapTrees | boolean | false | - | Laser tree farm |
breakLeaves | boolean | false | - | Laser tree farm |
silktouch | boolean | false | - | Laser tree farm |
tier | Number | 1 | 1 or 2 | Cloaking core |
videoChannel | Number | -1 | ±INF | Camera, Monitor |
mode | String | redstone | up, down, redstone | Lift |
active | boolean | true | Enable/disable the machine | Enantiomorphic reactor core |
Home
Dependencies
Frequently Asked Questions
Changelog
Tutorials
* First ship, first jump
* Tuning Tools
* Programmable blocks
* Lasers - Basic Tutorial
* Lasers - Advanced Boosting
Exploration
* World generation
* Air in space
* Planets and Transition Planes
* Warp Jump Checklist
Atomic
* Large Hadron Collider
* Accelerator Controller
* Accelerator Control Point
* Chiller
* Electromagnet
* Particles Collider
* Particles Injector
* Void Shell
* Electromagnetic Cell
Breathing
* Breathing
* Air Canister
* Air Generator
* Air Tank
* Energy Air Shield
* Warp armor
Collection
* Laser Tree Farm
* Mining Laser
Detection
* Camera and Monitor
* Cloaking
* Radar
* Siren
* Warp Field Isolation Block
Energy
* IC2 Reactor Laser
* Subspace Capacitor
* Enantiomorphic Reactor
Movement
* Lift
* Transporter Room
* Transporter Core
* Transporter Scanner
* Transporter Containment
* Transporter Beacon
Protection
* Hull
* Force field projector
* Force field relay
* Force field upgrades
Weapons
* Lasers - Basic Tutorial
* Lasers - Advanced Boosting
LUA API
* LUA methods
- for Detection
- for Energy
- for Movement
* LUA properties
- for Energy
- for Movement
* LUA events
* LUA change logs