Skip to content

About

Basic Lua documentation for Open Computer types for use with GTNH

Topics

Resources

Stars

46 stars

Watchers

2 watching

Forks

 
 

Latest commit

 

History

157 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTNH-OC-Lua-Documentation

Caution

The documentation is written for a modified version of Open Computers from GTNH modpack.

Important

The documentation targets GTNH 2.9. It is verified against components dumped from a running 2.9 world, so on 2.8 some of the methods described here may not exist yet, and a few may take different arguments. Everything documented is present in 2.9.

Content

Information

This documentation is written for the VS Code IDE and Lua extension by sumneko. It adds autocomplete code and function descriptions of Open Computers components and libraries.

Note

The documentation is written using generative models of artificial intelligence (ChatGPT). So mistakes are not excluded, feel free to write I will correct.

An example of the autocomplete documentation in action in vs code.

How to install

  1. Install extension Lua by sumneko: link
  2. Open the VS code settings (Ctrl+,).
  3. Search for Lua.workspace.library.
  4. Click Add Item and enter the path to lua folder in the input.
  5. Click OK

Add the path to the the docs in the Lua.workspace.library setting.

How to use

To use it, just import the required library and if there is documentation for it, everything will work automatically.

If you want to use documentation for components, pass the component type as parameter when calling functions:

  • For component.proxy

    local proxy = component.proxy("address", "type")
  • For component.getPrimary

    local proxy = component.getPrimary("type")

For a list of supported components, see the section What's already done

An example of autocomplete documentation from component.

What's already done

Documentation is ready for these 28 libraries.

What a script reaches for

Library What it is for
component the components attached to this machine
computer the machine itself: energy, uptime, signals, shutdown
event waiting for and reacting to signals
filesystem files and directories, mounts and paths
io opening files and the standard streams
term reading and writing on the terminal
text trimming, padding, wrapping and tokenizing strings
unicode string functions that count characters, not bytes
serialization turning tables into text and back
os time, environment variables, sleeping, running commands
shell the working directory, aliases, resolving and running programs
internet HTTP requests and TCP sockets
thread running several things at once
keyboard key codes and which keys are held down
colors the sixteen dye colours by name
sides the six sides by name, and their opposites
note note block pitches by name and frequency
uuid generating a random address
robot moving, turning and interacting, for a robot
bit32 bitwise operations on 32 bit integers
nbt reading the NBT trees of a Data Card as plain tables
buffer the buffered stream that io.open returns

Lower level, mostly used by the system

Library What it is for
tty the terminal device term is built on and inherits from
process the process table, environments and handles
package module loading, that is what stands behind require
devfs the /dev file system, where components appear as files
vt100 the ANSI escape sequences the terminal understands
transforms range helpers for tables, used while parsing command lines

Documentation is ready for the following 165 components, grouped by the mod that provides them. Some names look odd — caninv, blockjar_0, tile_for_apiculture_0_name — because OpenComputers derives a component name from the block itself whenever no driver declares one. Those are the names the game really answers to.

OpenComputers — cards (13) · OpenComputers — upgrades (18) · OpenComputers — blocks and machines (14) · Applied Energistics 2 (10) · AE2 Fluid Craft Rework (6) · Thaumic Energistics (4) · GregTech (6) · Computronics (16) · OpenSecurity (10) · Forestry and Magic Bees (13) · Thaumcraft (6) · IndustrialCraft 2 (3) · Railcraft (5) · Open Modular Turrets (10) · Draconic Evolution (15) · Other mods (10) · Vanilla blocks, through an adapter (6)

OpenComputers — cards

Component What it is
data Data Card
debug Debug Card, creative only
drive hard drive in unmanaged mode
eeprom EEPROM
filesystem hard drive, floppy or RAID in managed mode
gpu Graphics Card
internet Internet Card
keyboard Keyboard, no methods of its own
modem Network Card and Wireless Network Card
redstone Redstone Card, in both the plain and the wireless variant
tps_card TPS Card
tunnel Linked Card
world_sensor World Sensor Card

OpenComputers — upgrades

Component What it is
angel Angel Upgrade, no methods of its own
barcode_reader Barcode Reader Upgrade, no methods of its own
chunkloader Chunkloader Upgrade
configurator Configurator Upgrade, which edits EnderIO conduits
crafting Crafting Upgrade
database Database Upgrade
experience Experience Upgrade
generator Generator Upgrade
geolyzer Geolyzer
inventory_controller Inventory Controller Upgrade
leash Leash Upgrade
motion_sensor Motion Sensor
navigation Navigation Upgrade
piston Piston Upgrade
sign Sign Upgrade
tank_controller Tank Controller Upgrade
tractor_beam Tractor Beam Upgrade
trading Trading Upgrade

OpenComputers — blocks and machines

Component What it is
assembler Assembler
computer a computer case or a robot, seen from another machine
disk_drive Disk Drive block and the server rack mountable
drone the drone
hologram Hologram Projector
microcontroller a microcontroller, seen from another machine
net_splitter Net Splitter
printer3d 3D Printer
relay Relay and Access Point
robot the robot, from inside and through an adapter
screen Screen, all three tiers
tablet the tablet, from the program running on it
transposer Transposer
waypoint Waypoint

Applied Energistics 2

Component What it is
aemultipart a cable bus, that is any block with AE2 parts on it
me_cellworkbench ME Cell Workbench
me_controller ME Controller
me_exportbus ME Export Bus
me_importbus ME Import Bus
me_interface ME Interface, block and cable part
me_interface_terminal ME Interface Terminal
me_storagebus ME Storage Bus
tilechest ME Chest
upgrade_me ME Upgrade for a robot or a drone

AE2 Fluid Craft Rework

Component What it is
fluid_exportbus ME Fluid Export Bus
fluid_importbus ME Fluid Import Bus
fluid_interface ME Fluid Interface, block and cable part
fluid_storagebus ME Fluid Storage Bus
level_maintainer Level Maintainer
oc_pattern_editor OC Pattern Editor

Thaumic Energistics

Component What it is
essentia_exportbus ME Essentia Export Bus
essentia_importbus ME Essentia Import Bus
essentia_storagebus ME Essentia Storage Bus
thaumicenergistics_block_essentia_vibration_chamber Essentia Vibration Chamber

GregTech

Component What it is
bec_diode Bartworks Energy Cluster diode
bec_io_node Bartworks Energy Cluster IO node
bec_storage Bartworks Energy Cluster storage block
gt_batterybuffer Battery Buffer
gt_energycontainer a block that only stores EU, such as a battery box
gt_machine any GregTech machine: progress, energy, circuit configuration

Computronics

Component What it is
advanced_cipher Advanced Cipher Block
beep Beep Card
camera Camera
chat_box Chat Box
cipher Cipher Block
colorful_lamp Colorful Lamp
colors Colorful Upgrade for a robot or a drone
iron_noteblock Iron Note Block
noise Noise Card
particle Particle Card
radar Radar
self_destruct Self Destruct Card
sound Sound Card
speech Speech Upgrade for a robot or a drone
speech_box Speech Box block
tape_drive Tape Drive

OpenSecurity

Component What it is
os_alarm Alarm
os_biometric Biometric Reader
os_cardwriter Card Writer
os_datablock Data Block
os_door door controller
os_energyturret Energy Turret
os_entdetector Entity Detector
os_keypad Keypad
os_magreader Magnetic Card Reader
os_rfidreader RFID Reader

Forestry and Magic Bees

Component What it is
alveary an energised alveary
beekeeper Beekeeper Upgrade for a robot or a drone
caninv a bee housing, named after its inventory
for_alveary_0 an alveary block
for_alveary_3 an energised alveary block
for_alveary_4 an energised alveary block
for_alveary_6 an alveary block
forestry_analyzer Analyzer
items a bee housing, named after its inventory
magicbees_magicapiary Magic Apiary from Magic Bees
swarminv a bee housing, named after its inventory
tile_for_apiculture_0_name an apiary or bee house
tile_for_apiculture_2_name an apiculture block

Thaumcraft

Component What it is
arcane_crafting Arcane Crafting Upgrade for a robot or a drone
blockessentiareservoir Essentia Reservoir
blockjar_0 a jar
blockmetaldevice_0 a metal device that only stores essentia
blockmetaldevice_1 a metal device that moves essentia, alembic or centrifuge
infusion_matrix runic matrix of an infusion altar

IndustrialCraft 2

Component What it is
reactor nuclear reactor block
reactor_chamber reactor chamber
reactor_redstone_port reactor redstone port

Railcraft

Component What it is
anchor world anchor
boiler_firebox firebox of a boiler
locomotive_relay Locomotive Relay, driven by Computronics
steam_turbine Steam Turbine
ticket_machine Ticket Machine, driven by Computronics

Open Modular Turrets

Component What it is
modtur_turretbasefive tier five turret base, the energy and essentia API
modtur_turretbasefour tier four turret base, the energy and essentia API
modtur_turretbaseone tier one turret base, the energy and essentia API
modtur_turretbasethree tier three turret base, the energy and essentia API
modtur_turretbasetwo tier two turret base, the energy and essentia API
tierFiveTurretBase tier five turret base, the turret API
tierFourTurretBase tier four turret base, the turret API
tierOneTurretBase tier one turret base, the turret API
tierThreeTurretBase tier three turret base, the turret API
tierTwoTurretBase tier two turret base, the turret API

Draconic Evolution

Component What it is
draconic_chest Draconic Chest, only its RF energy methods
draconic_reactor reactor, through an Energy Injector or a Stabilizer
draconic_rf_storage Energy Pylon of an energy core
draconicevolution_energycrystal0 energy core crystal, variant 0
draconicevolution_energycrystal1 energy core crystal, variant 1
draconicevolution_energycrystal2 energy core crystal, variant 2
draconicevolution_energycrystal3 energy core crystal, variant 3
draconicevolution_energycrystal4 energy core crystal, variant 4
draconicevolution_energycrystal5 energy core crystal, variant 5
draconicevolution_energyinfuser Energy Infuser, only its RF energy methods
draconicevolution_generator a generator, only its RF energy methods
draconicevolution_grinder Mob Grinder, only its RF energy methods
fluid_gate Fluid Gate, a fluid transfer limiter
flux_gate Flux Gate, an RF transfer limiter
particle_generator Particle Generator

Other mods

Component What it is
bc_pipe BuildCraft — a pipe
blood_altar Blood Magic — Blood Altar
ender_chest EnderStorage — an ender chest
enderchest_1 EnderStorage — an ender chest under a derived name
enderio_machine EnderIO — a machine
generatorfurnace a furnace generator
glasses OpenGlasses — the AR glasses terminal
info_panel Display Panels — Information Panel, basic and advanced
master_ritual_stone Blood Magic — Master Ritual Stone
stargate SGCraft — a stargate

Vanilla blocks, through an adapter

Component What it is
beacon Beacon
brewing_stand Brewing Stand
comparator Comparator
furnace Furnace
jukebox Jukebox
note_block Note Block

About

Basic Lua documentation for Open Computer types for use with GTNH

Topics

Resources

Stars

46 stars

Watchers

2 watching

Forks

Contributors

Languages