Integration
Introduction¶
You can also use Computer Craft: Tweaked to control your reactor and turbines! For that, some knowledge in LUA or even in CC:Tweaked would be great!
You can use any Reactor Casing as peripheral, as long as the reactor has been assembled once before!
Peripheral¶
Peripheral Name
thorium_reactor
Example
local reactor = peripheral.find("thorium_reactor")
Example Script¶
Show Script
startup.lua | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
Functions¶
isAssembled()¶
Description
Returns true or false whether the reactor is assembled or not!
Method
isAssembled() -> boolean
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorState()¶
Description
Returns the current operating mode of the reactor as a string.
Method
getReactorState() -> string
return: "starting", "running", "stop"
Example
example.lua | |
---|---|
1 2 3 |
|
setReactorState()¶
Description
Set the reactor operating state! When an invalid mode is passed, the reactor will use "stop" as default.
Method
setReactorState(string mode)
mode: "starting", "running", "stop"
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorFluidAmountOut()¶
Description
Returns the amount of heated molten salt in the reactor tank!
Method
getReactorFluidAmountOut() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorFluidCapacityOut()¶
Description
Returns the capacity of the reactor output tank! (Heated Molten Salt)
Method
getReactorFluidCapacityOut() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorFluidAmountIn()¶
Description
Returns the amount of molten salt in the reactor tank!
Method
getReactorFluidAmountIn() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorFluidCapacityIn()¶
Description
Returns the capacity of the reactor input tank! (Molten Salt)
Method
getReactorFluidCapacityIn() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorCapacity()¶
Description
Returns the total capacity of the reactor!
Method
getReactorCapacity() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorCurrentLoadSet()¶
Description
Returns the value of current fueled uranium in percent!
Method
getReactorCurrentLoadSet() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorTargetLoadSet()¶
Description
Returns the set/wanted uranium fuel fill level in percent!
Method
getReactorTargetLoadSet() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
setReactorTargetLoadSet()¶
Description
Set the wanted uranium fuel fill level in percent!
Method
setReactorTargetLoadSet(Integer rate)
rate: 0 - 100
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorStatusPercent()¶
Description
Returns the current health rate of the reactor in percent!
Method
getReactorStatusPercent() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorContainmentPercent()¶
Description
Returns the current containment rate of the reactor in percent!
Method
getReactorContainmentPercent() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorRadiation()¶
Description
Returns the current escaping radiation of the reactor in µSv!
Method
getReactorRadiation() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
isReactorScrammed()¶
Description
Returns whether the reactor is scrammed or not!
Method
isReactorScrammed() -> boolean
Example
example.lua | |
---|---|
1 2 3 |
|
setReactorScrammed()¶
Description
Set the reactor operating state! When an invalid mode is passed, the reactor will use "stop" as default.
Method
setReactorScrammed(boolean state)
state: true, false
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorRunningSince()¶
Description
Returns the time the reactor has run until last startup! Format: 5 seconds = 5 seconds * 20 ticks = 100
Method
getReactorRunningSince() -> Long
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorCurrentTemperature()¶
Description
Returns the reactors current temperature in degree Celsius!
Method
getReactorCurrentTemperature() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorTargetTemperature()¶
Description
Returns the reactors target temperature in degree Celsius!
Method
getReactorTargetTemperature() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorNotification()¶
Description
Returns the current notification of the reactor! For example when the reactor gets scrammed!
Method
getReactorNotification() -> String
Example
example.lua | |
---|---|
1 2 3 |
|
getReactorLoad()¶
Description
Returns the load of the reactor!
Method
getReactorLoad() -> Float
Example
example.lua | |
---|---|
1 2 3 |
|
getFuelRodStatus()¶
Description
Returns the fuel level of the given fuel rod in percent!
Method
getFuelRodStatus(Integer index) -> Float
index: 0 - 80
getFuelRodStatusMap()¶
Description
Returns the fuel level of the given fuel rod in percent in a lua table!
Method
getFuelRodStatusMap() -> Table: Int, Int
Example
example.lua | |
---|---|
1 2 3 4 5 |
|
Added In
ThoriumReactors version 0.2b
getDepletedFuelRodStatus()¶
Description
Returns the depleted fuel level of the given fuel rod in percent!
Method
getDepletedFuelRodStatus(Integer index) -> Float
index: 0 - 80
Example
example.lua | |
---|---|
1 2 3 |
|
getDepletedFuelRodStatusMap()¶
Description
Returns the depleted fuel level of the given fuel rod in percent in a lua table!
Method
getDepletedFuelRodStatusMap() -> Table: Int, Int
Example
example.lua | |
---|---|
1 2 3 4 5 |
|
Added In
ThoriumReactors version 0.2b
getCurrentControlRodStatus()¶
Description
Returns the current control rod insert value in percent!
Method
getCurrentControlRodStatus(Integer index) -> Float
index: 0 - 63
Example
example.lua | |
---|---|
1 2 3 |
|
getCurrentControlRodStatusMap()¶
Description
Returns the depleted fuel level of the given fuel rod in percent in a lua table!
Method
getCurrentControlRodStatusMap() -> Table: Int, Int
Example
example.lua | |
---|---|
1 2 3 4 5 |
|
Added In
ThoriumReactors version 0.2b
getTargetControlRodStatus()¶
Description
Returns the target control rod insert value in percent!
Method
getTargetControlRodStatus(Integer index) -> Float
index: 0 - 63
Example
example.lua | |
---|---|
1 2 3 |
|
getTargetControlRodStatusMap()¶
Description
Returns the depleted fuel level of the given fuel rod in percent in a lua table!
Method
getTargetControlRodStatusMap() -> Table: Int, Int
Example
example.lua | |
---|---|
1 2 3 4 5 |
|
Added In
ThoriumReactors version 0.2b
setTargetControlRodStatus()¶
Description
Sets the target control rod insert value!
Method
setTargetControlRodStatus(Integer index, Integer value)
index: 0 - 63
value: 0 - 100
Example
example.lua | |
---|---|
1 2 3 4 |
|
isTurbineActive()¶
Description
Returns true or false whether the turbine with the id is active.
Method
isTurbineActive(Integer index) -> boolean
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
setTurbineActive()¶
Description
Sets the activation state of a turbine.
Method
setTurbineActive(Integer index, Boolean state)
index: 0 - ?
state: true - false
Example
example.lua | |
---|---|
1 2 3 |
|
isTurbineCoilsEngaged()¶
Description
Returns true or false whether the turbine coils are engaged or not.
Method
isTurbineCoilsEngaged(Integer index) -> boolean
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
setTurbineCoilsEngaged()¶
Description
Sets the coil engage state of a turbine.
Method
setTurbineCoilsEngaged(Integer index, Boolean state)
index: 0 - ?
state: true - false
Example
example.lua | |
---|---|
1 2 3 |
|
copyConfigurationToAllTurbines()¶
Description
Copy the settings from the given turbine to all others.
Method
copyConfigurationToAllTurbines(Integer index)
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 4 |
|
isTurbineAssembled()¶
Description
Returns true or false whether the turbine is assembled or not.
Method
isTurbineAssembled(Integer index) -> boolean
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineHeight()¶
Description
Returns the total height of the turbine.
Method
getTurbineHeight(Integer index) -> Integer
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineCurrentFlow()¶
Description
Returns the actual flow rate of the turbine.
Method
getTurbineCurrentFlow(Integer index) -> Integer
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineTargetFlow()¶
Description
Returns the target flow rate of the turbine.
Method
getTurbineTargetFlow(Integer index) -> Integer
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
setTurbineTargetFlow()¶
Description
Sets the target flow rate of the turbine.
Method
setTurbineTargetFlow(Integer index, Integer flowrate)
index: 0 - ?
index: 0 - 2500
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineGeneration()¶
Description
Returns the target flow rate of the turbine.
Method
getTurbineGeneration(Integer index) -> Float
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineSpeed()¶
Description
Returns the current turbine speed of the turbine.
Method
getTurbineSpeed(Integer index) -> Float
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbineEnergyModifier()¶
Description
Returns the current turbine speed of the turbine.
Method
getTurbineEnergyModifier(Integer index) -> Float
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbinePosition()¶
Description
Returns the turbines position in a table.
Method
getTurbinePosition(Integer index) -> Table
Table:
{
"x": -127,
"y": 80,
"z": 322
}
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbinePositionString()¶
Description
Returns the turbines position in a string.
Method
getTurbinePosition(Integer index) -> String
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 |
|
getTurbinePositions()¶
Description
Returns all turbines positions in a table.
Method
getTurbinePositions(Integer index) -> Table
Table:
{
{
"x": -127,
"y": 80,
"z": 322
"turbineId": 0
},
{
"x": -127,
"y": 80,
"z": 322
"turbineId": 1
}
}
index: 0 - ?
Example
example.lua | |
---|---|
1 2 3 4 5 6 7 |
|
getTurbineCount()¶
Description
Returns the amount of all turbines.
Method
getTurbineCount() -> Integer
Example
example.lua | |
---|---|
1 2 3 |
|