Skip to content

Codex Logic Computercraft

CaptainGummiball edited this page Nov 10, 2026 · 1 revision

ComputerCraft

With CC: Tweaked installed, computers can read QNet blocks and order from the Factory Controller. Put a computer next to the block or connect it with a wired modem. Everything runs on the server.

The integration can be switched off with features.integration.computercraft (default true); then every call ends with the error "QNet: the computer integration is switched off on this server".

Every QNet block: type qnet

Every QNet block with a block entity is a peripheral of the type qnet:

Function Returns
getInfo() every value and text of the block's screen, by name, plus type and, for plants, formed
getReadings() the named readings of a machine (temperature, power and so on)
getCommands() the commands the block takes

For the storage and logic area this means:

  • Bulk Tank Controller: getInfo() gives type = large_gas_tank, formed, status, gas, contents and contentsMax, amount, capacity, volume, taken and given.
  • Warehouse Controller: getInfo() gives type = warehouse, formed, status, contents and contentsMax, racks, amount, capacity, kinds and kind_limit.
  • Storage Controller, units, terminal, interfaces, Grid Monitor, Machine Interface: no screen values; getInfo() returns an empty table. Use the Grid Monitor's redstone signal to bring its state to a computer.

Factory Controller: type qnet_factory

The Factory Controller is also a peripheral of the type qnet_factory.

Reading (always allowed)

Function Returns
getFactory() energy, energyCapacity, activeJobs, maxJobs, powered, linked, computerOrders
getCraftables() every item id the linked machines can make, sorted
getOrders() orders and stock targets: id, kind (make or stock), item, amount, stock, problem
getJobs() jobs: order, recipe, output, expect, made, state, machine
getMachines() machines: block, types, tier, busy
plan(item, amount) the plan preview: complete, problem, steps (recipe, type, runs), fromStock and missing (kind, id, amount)

Ordering (only while allowed)

Function Effect
order(item, amount) places a Make order, returns its id
setStockTarget(item, amount) sets a stock target with the machines as source, returns its id
cancel(id) cancels an order or target, returns whether there was one

Ordering works only while an admin has set "Computers may order: on" in the Machines tab of the controller's window. Otherwise these calls end with an error that says so. Other errors: "amount must be positive", "the linked machines cannot make …".

Amounts above 1,000,000 are cut. The lists are capped: 4,096 craftables, 256 orders, 512 jobs and 512 machines.

Tip

Example local f = peripheral.find("qnet_factory") and then f.order("minecraft:iron_ingot", 64) orders 64 iron ingots, if the linked machines can make them.

Note

No rights check Computers are not players: a computer that may order can order everything, whatever its owner's role. Only switch computer orders on where you trust every computer that can reach the controller.

QNet Codex

Getting Started

Energy

Processing

Rift

Storage

Logic

Reference

Items and Blocks

Clone this wiki locally