Repository navigation
Codex Reference Computercraft
With CC: Tweaked installed, a computer next to a QNet machine or plant controller (or connected to it with a wired modem) can read it and, where the machine allows it, control it. Everything runs on the server thread, and every command is checked on the server: a wrong value never changes anything, it returns an error text instead.
Switch: features.integration.computercraft (default true). While it is off, every QNet function of machines and the Factory Controller answers with the error "QNet: the computer integration is switched off on this server".
QNet adds functions to the blocks themselves, so they show up as peripheral types of their own:
| Type | Blocks | Functions |
|---|---|---|
qnet |
every QNet machine and plant controller | reading, and commands on some power plants |
qnet_factory |
the |
reading, plans and orders |
qnet |
the controllers of the Rift structures | reading only |
peripheral.find("qnet") finds every machine and controller around the computer. Ports are not peripherals: connect the computer to the controller.
-
getInfo(): every value and text of the machine's window as a table, keyed by the label of each line. It also holdstype(the window) and, for plants,formed(true or false). Bars come with a second key ending inMax. -
getReadings(): the named readings the machine has, for exampleenergyStored,energyCapacity,progressandstatus. -
getCommands(): the commands this machine takes (an empty list for most machines).
Single readings have their own functions: temperature(), powerOutput(), energyStored(), fuelLevel(), turbineRpm(), reactorFlux(), controlRodPosition(), plasmaTemperature(), stability(), alarmState(), coolantTemperature(), steamFlow(), netPower(), fusionRate(), tritiumBreedingRate(), reactorState(), windSpeed(), heatStored(), coilTemperature() and singularityMass(). A reading that a machine does not have raises the error "this machine has no reading '…'". With the advanced reactor model the fission reactor also offers reactivity(), xenon(), voidReactivity() and doublingTime().
Readings keep working on a machine that the server has switched off; commands do not ("this machine is switched off on this server").
Only these machines take commands. Numbers must lie inside the range of the machine; switches take true or false.
| Machine | Commands |
|---|---|
|
|
setSetpoint(celsius) from 100 to 350 °C |
|
|
setFlow(mbPerTick), setGenerator(on), setOverspeedTrip(on)
|
|
|
setFuelFlow(mbPerTick), setGenerator(on), setOverspeedTrip(on)
|
|
|
start(), shutdown(), setPowerSetpoint(ePerTick), setFollowDemand(on)
|
|
|
setControlRodTarget(percent) from 0 to 100, scram(), reset(), setAutoScram(on), setAutoScramTemperature(celsius) from 300 to 1,200 °C |
|
|
start(), shutdown(), setInjectionTarget(mbPerTick), setAuxHeating(ePerTick), setAutoRestart(on)
|
|
|
start(), shutdown(), reset(), setFeed(mbPerTick), setControlRodTarget(percent) from 20 to 100, setAuto(on)
|
|
|
start(), shutdown(), reset(), setFeed(perTick), setJet(share) from 0 to 1, setAuto(on), splitCapsule()
|
|
|
shutdown(), reset(), setPowerSetpoint(ePerTick)
|
|
|
setRedstoneMode(mode) with "always", "release_on_signal" or "block_on_signal"
|
|
|
setProtection(on) |
|
|
setCooling(on) |
|
|
setHeatOutput(huPerTick) |
|
|
setFuelCell(on) |
Flows, feeds and power setpoints go from 0 up to what the formed plant can take; the error text names the exact range. Some commands are refused with a reason, for example a reset while the core is still too hot, automatic control without the diagnostics block it needs, or switching off a protection while the server runs in safe mode.
The qnet_factory functions:
-
getFactory(): the state of the controller. -
getCraftables(): the item ids the linked machines can make. -
getOrders(),getJobs(),getMachines(): the orders, the running jobs and the linked machines. -
plan(item, amount): what an order would need and do, without ordering. -
order(item, amount): makes the amount once; returns the order number. -
setStockTarget(item, amount): keeps that amount in stock; returns the order number. -
cancel(id): cancels an order.
Reading always works. order, setStockTarget and cancel only work while the button in the controller's window says "Computers may order: on"; otherwise they raise an error.
The controllers of the Rift structures offer getInfo() (structure, link, the state of the complex, energy, stability and the kind of world the rift is open to; never addresses), and, once linked to a complex, getJobs() and getBuffer(). Running the rift stays with the console.
A boiler controller next to the computer:
-
local boiler = peripheral.find("qnet")finds it. -
print(boiler.getInfo().type)prints the kind of window it has. -
boiler.setSetpoint(250)sets its temperature setpoint to 250 °C.
QNet Codex
Getting Started
- Welcome to QNet
- The First Machines
- Tiers and Components
- Energy, Fluids and Gases
- Building Plants
- The Quanta Linker
- Teams and Rights
- Upgrades and Plant Modules
Energy
- Energy Overview
- Basic Dynamo
- Thermoelectric Generator
- Stirling Generator
- Geothermal Heat Exchanger
- Solar Array
- Wind Turbine
- Solar Thermal Field
- Industrial Boiler
- Steam Turbine
- Gasifier
- Natural Gas and the Gas Derrick
- Gas Engine
- Gas Turbine
- Fission Reactor
- Nuclear Fuel Cycle
- Advanced Reactor Model
- Centrifuge Cascade
- Tokamak
- Little Star
- Micro Black Hole Plant
- Hawking Reactor
- Capacitor Bank
- Battery Hall
- Molten-Salt Store
- Gravity Store
- SMES
- Dimensional Store
- Process Heat
- Electric Heater and Heat Exchanger
- Incidents and Safety
- Radiation
Processing
- Crusher
- Induction Furnace
- Metal Former
- Assembler
- Plant Processor
- Farming Station
- Tree Harvester
- Electrolyzer
- Air Separator
- Chemical Reactor
- Industrial Centrifuge
- Crystallizer
- Tunnel Furnace
- Foundry
- Chemical Plant
- Assembly Complex
- Agricultural Facility
- Particle Facility
- Quantum Facility
- Matter Reconstructor
- Deep Core Extractor
- Plant Speed Modules
- Materials and Recipes
Rift
- The Rift
- Building the Complex
- Structure Parts
- Rift Gate Assembly
- Power Injection Array
- Stabilization Tower
- Coordinate Computation Array
- Dimensional Observatory
- Extraction Array
- Matter Receiving Facility
- Linking the Complex
- Running the Rift
- The Rift Console
- Research and Signals
- The Research Tree
- Mining
- Sectors and Diminishing Returns
- The Job Program
- Rift Map Table
- Command Terminal and Monitors
- Rift Materials
Storage
- The Storage Network
- Storage Controller
- Storage Units
- Storage Access Terminal
- Storage Interface
- External Storage Interface
- Bulk Tank
- Warehouse
- Linking Storage
Logic
Reference
Items and Blocks
- Advanced Circuit
- Ash
- Basic Circuit
- Bio Fertilizer
- Biomass
- Block Die
- Block Mold
- Casting Basin
- Charged Quantum Crystal
- Coal Dust
- Conductive Alloy Ingot
- Conveyor
- Copper Coil
- Copper Dust
- Copper Plate
- Copper Wire
- Creative Battery
- Creative Gas Tank
- Deepslate Lead Ore
- Deepslate Lithium Ore
- Deepslate Uranium Ore
- Efficiency Upgrade
- Emergency Vent
- Energy Cell
- Energy Transformer
- Exotic Matter
- Field Emitter
- Field Stabilizer
- Fluid Tank
- Gas Compressor
- Gas Tank
- Gear Die
- Gear Mold
- Generator Coil
- Gold Dust
- Gold Plate
- Heat Exchanger Tubes
- Induction Coil
- Industrial Frame
- Ingot Mold
- Iron Dust
- Iron Plate
- Irradiated Residue
- Laser Optic
- Block of Lead
- Lead Ingot
- Lead Ore
- Lithium Carbonate
- Lithium Dust
- Lithium Ore
- Machine Frame
- Nugget Mold
- Parallel Upgrade
- Pattern Card
- Plant Fiber
- Plate Die
- Plate Mold
- Polymer Sheet
- Precision Alloy Ingot
- Precision Frame
- Pump
- Quanta Linker
- Quantum Crystal
- Quantum Frame
- Quantum Processor
- Range Upgrade
- Raw Lead
- Raw Lithium
- Raw Uranium
- Refractory Bricks
- Rod Die
- Rod Mold
- Rotor Blade
- Rotor Shaft
- Sensor Module
- Servo Motor
- Silicon
- Silicon Boule
- Silicon Wafer
- Solidified Melt
- Speed Upgrade
- Stabilized Matter
- Steel Blend
- Steel Dust
- Steel Gear
- Steel Ingot
- Steel Plate
- Steel Rod
- Superconductor Wire
- Uranium Dust
- Uranium Ore
- Wire Die
- Yield Upgrade