Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hbmmods/hbm-s-nuclear-tech-git/llms.txt

Use this file to discover all available pages before exploring further.

HBM’s Nuclear Tech Mod includes first-class integration with the OpenComputers mod (OC), exposing dozens of NTM machines as OC components that Lua scripts can query and control at runtime. This unlocks automation far beyond what Redstone Over Radio can express: a Lua script can read exact core temperatures, adjust control rod insertion levels with arithmetic precision, detect coolant loss, trigger emergency shutdowns, manage fluid valve states, and display real-time reactor dashboards on OC screens — all without redstone dust. The integration is implemented as a compile-only dependency, meaning NTM loads and runs normally even if OpenComputers is not installed; the component interfaces are simply inactive. Contributors to the OC integration include Voxelstice, BallOfEnergy1 (Microwave), PewPewCricket, kelllllen, and Toshayo.

Architecture

The integration is centred on two classes:
  • CompatHandler (com.hbm.handler.CompatHandler) — utility class providing helper functions (e.g., converting steam type enums to/from integers) and the OCComponent marker interface that machine tile entities implement.
  • TileEntityProxyCombo (com.hbm.tileentity.TileEntityProxyCombo) — a proxy tile entity that wraps any NTM machine and exposes its OCComponent + SimpleComponent interfaces to OpenComputers, along with the full RoR INDEX API (IRORValueProvider, IRORInteractive).
Machine tile entities that want OC support implement CompatHandler.OCComponent and declare their component name via getComponentName(). The @Optional.Method(modid = "OpenComputers") annotation ensures the @Callback-annotated methods are ignored when OC is absent.

Registered OC Components

The following NTM machines expose OpenComputers component names and @Callback methods:
Component NameMachine
ntm_pwr_controlPWR Controller (TileEntityPWRController)
ntm_turbineSteam Turbine, Industrial Turbine, Large Turbine, Chungus Turbine
ntm_gas_turbineGas Turbine
ntm_combustion_engineCombustion Engine
ntm_fusion_torusFusion Reactor Torus
ntm_fusion_boilerFusion Boiler
ntm_fusion_breederFusion Breeder
ntm_fusion_klystronFusion Klystron
ntm_fusion_mhdtFusion MHD Topping Cycle
ntm_icf_reactorInertial Confinement Fusion Reactor
ntm_energy_storageBattery Base
ntm_energy_storage_legacyLegacy Machine Battery

Connecting an OC Computer to an NTM Machine

1

Install OpenComputers

Download and install the OpenComputers mod. NTM will automatically detect it at startup and activate the integration layer.
2

Place an OC Adapter block

In-game, craft an OC Adapter block and place it directly adjacent to the NTM machine you want to control. The adapter must share a face with the machine’s tile entity.
3

Connect cables and a computer

Run OC cables from the adapter to your computer case. Add a CPU, RAM, and either a floppy drive or hard drive. Power the computer with an OC power converter attached to your NTM power grid.
4

Discover the component

Boot the computer and run components (or component.list() in Lua) to confirm the NTM component appears under its registered name (e.g., ntm_pwr_control).
5

Write or load a Lua script

Use component.proxy(address) to get a proxy object and call methods on it directly. Or use the provided PWRangler floppy disk for PWR reactor management.

Available Callbacks — Steam Turbine

The turbine components (ntm_turbine) expose the following methods:
-- Returns: inputFill, inputCapacity, outputFill, outputCapacity
local inAmt, inCap, outAmt, outCap = turbine.getFluid()

-- Returns: steamType integer (0=steam, 1=hot, 2=superhot, 3=ultrahot)
local steamType = turbine.getType()

-- Sets the input fluid type (integer 0–3)
turbine.setType(2)  -- set to super-hot steam

-- Returns: current power buffer (HE units)
local power = turbine.getPower()

-- Returns all info in one call: inFill, inCap, outFill, outCap, steamType, power
local t = {turbine.getInfo()}

PWR Controller Callbacks

The ntm_pwr_control component (PWR reactor controller) is the most feature-rich component, used by the included PWRangler automation script:
local component = require("component")
local pwr = component.ntm_pwr_control

-- Read core and hull heat: returns coreHeat, hullHeat, coreHeatCapacity, hullHeatCapacityBase
local coreHeat, hullHeat, coreHeatCapacity, hullHeatCapacityBase = pwr.getHeat()

-- Read coolant status: returns coldAmount, coldCapacity, hotAmount, hotCapacity
local coldAmt, coldCap, hotAmt, hotCap = pwr.getCoolantInfo()

-- Read neutron flux
local flux = pwr.getFlux()

-- Read control rod levels: returns rodTarget (set point), rodLevel (actual position)
-- Both values are 0–100; 0 = fully inserted (SCRAM), 100 = fully withdrawn
local rodTarget, rodLevel = pwr.getLevel()

-- Set control rod target insertion level
pwr.setLevel(50)  -- set target to 50% withdrawn

PWRangler — Included Automation Script

NTM ships a complete Lua script on a virtual floppy disk (hbm/disks/pwrangler/usr/bin/PWRangler.lua). It provides a full-screen control panel for the PWR reactor:
  • Real-time core heat, hull heat, and neutron flux readouts
  • Visual control rod position bar graph
  • Coolant buffer gauges for both hot and cold coolant loops with delta indicators
  • Interactive +1/+5/+10 and −1/−5/−10 control rod buttons
  • Emergency SCRAM button (sets rod level to 100 = fully inserted)
  • Configurable automatic SCRAM triggers:
    • Core overheat ESTOP — SCRAMs if core heat exceeds 90% of capacity
    • Coolant loss ESTOP — SCRAMs if cold coolant drops below 10,000 mB
    • Hot coolant overflow ESTOP — SCRAMs if hot coolant exceeds 50% of capacity
The script refreshes every 250 ms and uses OC touch/drop events for button interaction on a GPU-equipped screen.
The PWRangler script uses component.list("ntm_pwr_control") to auto-discover the PWR Controller address. If you have multiple PWR reactors, only the first discovered will be managed. Extend the script to handle multiple addresses for multi-reactor plants.

Example: Simple Reactor Safety Script

local component = require("component")
local pwr = component.ntm_pwr_control

local SCRAM_HEAT_FRACTION = 0.85  -- SCRAM if heat > 85% of capacity

while true do
  -- getHeat() returns: coreHeat, hullHeat, coreHeatCapacity, hullHeatCapacityBase
  local coreHeat, _, coreHeatCapacity = pwr.getHeat()

  if coreHeat > coreHeatCapacity * SCRAM_HEAT_FRACTION then
    pwr.setLevel(100)  -- fully insert rods (SCRAM)
    print("SCRAM triggered! Core heat: " .. coreHeat)
  end

  os.sleep(0.5)
end

Steam Type Mapping

The CompatHandler.steamTypeToInt / intToSteamType helpers define the following mapping used by turbine components:
IntegerFluid
0Steam (standard)
1Hot Steam
2Super-Hot Steam
3Ultra-Hot Steam
OpenComputers is a compile-only dependency for NTM. If OC is not installed, all @Callback annotated methods are silently ignored and the @Optional.Interface annotations prevent class loading errors. You do not need OC installed for NTM to function — the integration only activates when both mods are present.

Build docs developers (and LLMs) love