Reactor Computer Port

From Technic Wiki
Jump to: navigation, search
Reactor Computer Port
Reactor Computer Port.png
Reactor Computer Port
Mod

Big Reactors

Type

Multiblock Part

Durability

N/A

Stackable

Yes (64)

Energy

?

Storage

?

A Reactor Computer Port is a utility block that can be used to monitor or control a Multiblock Reactor remotely, using ComputerCraft's Computers.

The Computer Port provides the finest level of control over a reactor's operation, and is capable of querying and controlling a reactor much faster than either Redstone or RedNet. It acts like a standard ComputerCraft Peripheral.

Crafting

Reactor Casing
Gold Ingot
Reactor Casing
Redstone Dust
Reactor Redstone Port
Redstone Dust
Reactor Casing
Gold Ingot
Reactor Casing
Reactor Computer Port


Lua Methods (0.4)

The following methods are current as of Big Reactors 0.4.0A.

Method Name Arguments Return Type Description
getConnected None Boolean Returns true if the computer port is connected to a valid Multiblock Reactor.
getActive None Boolean Returns true if the reactor is active (consuming fuel and generating power), false otherwise.
getNumberOfControlRods None Integer Returns the number of control rods attached to this reactor. This is one more than the maximum control rod index.
getEnergyStored None Integer Returns the amount of energy stored in the Multiblock Reactor's internal energy buffer, in Redstone Flux (RF) units
getFuelTemperature None Integer Returns the temperature of the Multiblock Reactor's fuel, in degrees Centigrade.
getCasingTemperature None Integer Returns the temperature of the Multiblock Reactor's casing/frame, in degrees Centigrade.
getFuelAmount None Integer Returns the total amount of fuel contained in the reactor, in milli-buckets (mB)
getWasteAmount None Integer Returns the total amount of waste contained in the reactor, in milli-buckets (mB)
getFuelAmountMax None Integer Returns the total amount of fuel + waste which can be contained in the reactor at one time, in milli-buckets (mB)
getControlRodName Integer: control rod index String Returns the user-set name for the specified control rod, as a string. String is empty if the name is not set
getControlRodLevel Integer: control rod index Integer Returns an integer indicating how far the specified control rod is inserted into the reactor, range is from 0 (not inserted) to 100 (fully inserted)
getEnergyProducedLastTick None Float Returns an estimate of the Redstone Flux (RF) energy generated in the past tick. If the reactor is actively cooled, returns the amount of hot fluid produced in the past tick, in milli-Buckets (mB).
getHotFluidProducedLastTick None Float Returns the amount of hot fluid produced in the past tick, in milli-Buckets (mB). If the reactor is passively cooled, always returns 0.
getCoolantType None String or Nil Returns the Fluid Dictionary name of the type of fluid contained in the Multiblock Reactor's coolant tank, or Nil if the tank is empty.
getCoolantAmount None Integer Returns the amount of coolant fluid contained in the Multiblock Reactor's coolant tank, in milli-buckets (mB)
getCoolantAmountMax None Integer Returns to maximum amount of coolant fluid which can be contained in the Multiblock Reactor's coolant tank, in milli-buckets (mB)
getHotFluidType None String or Nil Returns the Fluid Dictionary name of the type of fluid contained in the Multiblock Reactor's hot-fluid tank, or Nil if the tank is empty.
getHotFluidAmount None Integer Returns the amount of superheated fluid contained in the Multiblock Reactor's hot-fluid tank, in milli-buckets (mB)
getHotFluidAmountMax None Integer Returns to maximum amount of hot fluid fluid which can be contained in the Multiblock Reactor's hot fluid tank, in milli-buckets (mB)
getFuelReactivity None Integer Returns the reactivity level of the reactor's fuel. 100 = 100 percent
getFuelConsumedLastTick None Float Returns the amount of fuel consumed last tick, in milli-buckets (mB). Note that fractional milliBuckets can be consumed, so this can return, for example, 0.5
isActivelyCooled None Boolean Returns true if the Multiblock Reactor is in "active cooling" mode, false otherwise
setActive Boolean: active? None Sets the reactor to be active if the argument is true, or inactive if the argument is false
setAllControlRodLevels Integer: insertion level (0-100) None Sets all control rods to the specified insertion level. Range is from 0 (not inserted) to 100 (fully inserted)
setControlRodLevel Integer: control rod index, Integer: insertion level (0-100) None Sets the specified control rod (first argument) to the specified insertion level (second argument). Insertion level range is from 0 to 100, as above.
doEjectWaste None None Instruct the reactor to attempt to eject any waste in the reactor via its access ports. The reactor will favor access ports set to Out. 1 ingot of waste will be ejected per 1000 mB currently in the reactor. If there is less than 1000 mB of waste in the reactor, nothing will happen.
doEjectFuel None None Instruct the reactor to attempt to eject any Fuel in the reactor via its access ports. The reactor will favor access ports set to Out. 1 ingot of Fuel will be ejected per 1000 mB currently in the reactor. If there is less than 1000 mB of Fuel in the reactor, nothing will happen.
getMinimumCoordinate None Integer Tuple Returns the smallest value Cartesian Coordinates(X,Y,Z) that contains some portion of the reactor in question. Can be accessed via: local xmin,ymin,zmin = reactor.getMinimumCoordinate()
getMaximumCoordinate None Integer Tuple Returns the largest value Cartesian Coordinates(X,Y,Z) that contains some portion of the reactor in question. Can be accessed via: local xmax,ymax,zmax = reactor.getMaximumCoordinate()

Lua Methods (0.3)

The following methods are current as of Big Reactors 0.3.0.

Method Name Arguments Return Type Description
getConnected None Boolean Returns true if the computer port is connected to a valid Multiblock Reactor.
getActive None Boolean Returns true if the reactor is active (consuming fuel and generating power), false otherwise.
getNumberOfControlRods None Integer Returns the number of control rods attached to this reactor. This is one more than the maximum control rod index.
getEnergyStored None Integer Returns the amount of energy stored in the Multiblock Reactor's internal energy buffer, in Redstone Flux (RF) units
getFuelTemperature None Integer Returns the temperature of the Multiblock Reactor's fuel, in degrees Centigrade.
getCasingTemperature None Integer Returns the temperature of the Multiblock Reactor's casing/frame, in degrees Centigrade.
getFuelAmount None Integer Returns the total amount of fuel contained in the reactor, in milli-buckets (mB)
getWasteAmount None Integer Returns the total amount of waste contained in the reactor, in milli-buckets (mB)
getFuelAmountMax None Integer Returns the total amount of fuel + waste which can be contained in the reactor at one time, in milli-buckets (mB)
getControlRodName Integer: control rod index String Returns the user-set name for the specified control rod, as a string. String is empty if the name is not set
getControlRodLevel Integer: control rod index Integer Returns an integer indicating how far the specified control rod is inserted into the reactor, range is from 0 (not inserted) to 100 (fully inserted)
getEnergyProducedLastTick None Float Returns an estimate of the Redstone Flux (RF) energy generated in the past tick. If the reactor is actively cooled, returns the amount of hot fluid produced in the past tick, in milli-Buckets (mB).
getHotFluidProducedLastTick None Float Returns the amount of hot fluid produced in the past tick, in milli-Buckets (mB). If the reactor is passively cooled, always returns 0.
getCoolantType None String or Nil Returns the Fluid Dictionary name of the type of fluid contained in the Multiblock Reactor's coolant tank, or Nil if the tank is empty.
getCoolantAmount None Integer Returns the amount of coolant fluid contained in the Multiblock Reactor's coolant tank, in milli-buckets (mB)
getCoolantAmountMax None Integer Returns to maximum amount of coolant fluid which can be contained in the Multiblock Reactor's coolant tank, in milli-buckets (mB)
getHotFluidType None String or Nil Returns the Fluid Dictionary name of the type of fluid contained in the Multiblock Reactor's hot-fluid tank, or Nil if the tank is empty.
getHotFluidAmount None Integer Returns the amount of superheated fluid contained in the Multiblock Reactor's hot-fluid tank, in milli-buckets (mB)
getHotFluidAmountMax None Integer Returns to maximum amount of hot fluid fluid which can be contained in the Multiblock Reactor's hot fluid tank, in milli-buckets (mB)
getFuelReactivity None Integer Returns the reactivity level of the reactor's fuel. 100 = 100 percent
getFuelConsumedLastTick None Float Returns the amount of fuel consumed last tick, in milli-buckets (mB). Note that fractional milliBuckets can be consumed, so this can return, for example, 0.5
isActivelyCooled None Boolean Returns true if the Multiblock Reactor is in "active cooling" mode, false otherwise
setActive Boolean: active? None Sets the reactor to be active if the argument is true, or inactive if the argument is false
setAllControlRodLevels Integer: insertion level (0-100) None Sets all control rods to the specified insertion level. Range is from 0 (not inserted) to 100 (fully inserted)
setControlRodLevel Integer: control rod index, Integer: insertion level (0-100) None Sets the specified control rod (first argument) to the specified insertion level (second argument). Insertion level range is from 0 to 100, as above.
doEjectWaste None None Instruct the reactor to attempt to eject any waste in the reactor via its access ports. The reactor will favor access ports set to Out. 1 ingot of waste will be ejected per 1000 mB currently in the reactor. If there is less than 1000 mB of waste in the reactor, nothing will happen.

Lua Methods (0.2)

In Big Reactors 0.2, the Computer Port exposes the following methods to Lua.

Method Name Arguments Return Type Description
getConnected None Boolean Returns true if the computer port is connected to a valid Multiblock Reactor.
getActive None Boolean Returns true if the reactor is active (consuming fuel and generating power), false otherwise.
getNumberOfControlRods None Integer Returns the number of control rods attached to this reactor. This is one more than the maximum control rod index.
getEnergyStored None Integer Returns the amount of energy stored in the Multiblock Reactor's internal energy buffer, in Redstone Flux (RF) units
getTemperature None Integer Returns the temperature of the Multiblock Reactor, in degrees Centigrade.
getTemperature Integer: control rod index Integer Returns the temperature of the control rod at the specified control rod index
getFuelAmount None Integer Returns the total amount of fuel contained in the reactor, in milli-buckets (mB)
getFuelAmount Integer: control rod index Integer Returns the total amount of fuel contained in the specified control rod, in milli-buckets (mB)
getWasteAmount None Integer Returns the total amount of waste contained in the reactor, in milli-buckets (mB)
getWasteAmount Integer: control rod index Integer Returns the total amount of waste contained in the specified control rod, in milli-buckets (mB)
getFuelAmountMax None Integer Returns the total amount of fuel + waste which can be contained in the reactor at one time, in milli-buckets (mB)
getControlRodFuelAmountMax None Integer Returns the total amount of fuel + waste which can be contained in a single control rod at one time, in milli-buckets (mB)
getControlRodName Integer: control rod index String Returns the user-set name for the specified control rod, as a string. String is empty if the name is not set
getControlRodLevel Integer: control rod index Integer Returns an integer indicating how far the specified control rod is inserted into the reactor, range is from 0 (not inserted) to 100 (fully inserted)
getEnergyProducedLastTick None Float Returns an estimate of the Redstone Flux (RF) energy generated in the past tick
setActive Boolean: active? None Sets the reactor to be active if the argument is true, or inactive if the argument is false
setAllControlRodLevels Integer: insertion level (0-100) None Sets all control rods to the specified insertion level. Range is from 0 (not inserted) to 100 (fully inserted)
setControlRodLevel Integer: control rod index, Integer: insertion level (0-100) None Sets the specified control rod (first argument) to the specified insertion level (second argument). Insertion level range is from 0 to 100, as above.
doEjectWaste None None Instruct the reactor to attempt to eject any waste in the reactor via its access ports. The reactor will favor access ports set to Out. 1 ingot of waste will be ejected per 1000 mB currently in the reactor. If there is less than 1000 mB of waste in the reactor, nothing will happen.

Notes

When writing programs to control your reactor, you should always ensure that the Computer Port is actually connected. Reactors located far away may disassemble and deactivate due to chunks unloading from the world. If your reactor is not chunkloaded, make sure to call getConnected().

If a Computer Port receives a non-getConnected() call and is not connected to a valid reactor, it will throw a Lua exception back to the Computer.

Example

Assuming your Computer Port is directly behind your Computer:

local reactor
reactor = peripheral.wrap("back")
reactor.getFuelTemperature()
reactor.setActive(true)

Another more complex example of a wall Display. Requires both turbine and reactor to be hooked to the computer via network cable and modems.

sSide = "top" --Side of the computer the screen is on
screenX = 1
 
function pts(out)
  screenX = screenX + 1
  peripheral.call(sSide, "write", out)
  peripheral.call(sSide, "setCursorPos",1,screenX)
end
 
function ptc()
  screenX = 1
  peripheral.call(sSide,"clear")
  peripheral.call(sSide,"setCursorPos",1,screenX)
end
 
peripheral.call(sSide,"setTextScale",4)--output scale, 4 works for a 7x3 block screen.
 
local react = peripheral.wrap("BigReactors-Reactor_0") 
local turb = peripheral.wrap("BigReactors-Turbine_0") 
 
while true do
  ptc()
  pts("Steam/t:\n"..turb.getFluidFlowRate())
  pts("Rotor  :\n"..turb.getRotorSpeed())
  pts("RF/t   :\n"..turb.getEnergyProducedLastTick())
  local eStored = turb.getEnergyStored()/1000
  pts("KRF St :\n"..eStored)
  pts("MB/t   :\n"..react.getFuelConsumedLastTick())
  os.sleep(1)
end

ReactorComputerDisplay.png