I am getting the same error, also with a computer, 6 monitors, and a BigReactor. I will paste the crash report and program below.
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!
Time: 3/15/15 4:08 PM
Description: Exception ticking world
java.lang.IllegalArgumentException: Empty string not allowed
at net.minecraft.nbt.NBTTagString.<init>(SourceFile:15)
at net.minecraft.nbt.NBTTagCompound.func_74778_a(SourceFile:84)
at dan200.computercraft.core.terminal.Terminal.writeToNBT(Terminal.java:347)
at dan200.computercraft.shared.common.ServerTerminal.writeDescription(ServerTerminal.java:96)
at dan200.computercraft.shared.peripheral.monitor.TileMonitor.writeDescription(TileMonitor.java:320)
at dan200.computercraft.shared.common.TileGeneric.func_145844_m(TileGeneric.java:170)
at net.minecraft.server.management.PlayerManager$PlayerInstance.func_151252_a(PlayerManager.java:591)
at net.minecraft.server.management.PlayerManager$PlayerInstance.func_73254_a(PlayerManager.java:533)
at net.minecraft.server.management.PlayerManager.func_72693_b(PlayerManager.java:67)
at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:185)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:625)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at net.minecraft.nbt.NBTTagString.<init>(SourceFile:15)
at net.minecraft.nbt.NBTTagCompound.func_74778_a(SourceFile:84)
at dan200.computercraft.core.terminal.Terminal.writeToNBT(Terminal.java:347)
at dan200.computercraft.shared.common.ServerTerminal.writeDescription(ServerTerminal.java:96)
at dan200.computercraft.shared.peripheral.monitor.TileMonitor.writeDescription(TileMonitor.java:320)
at dan200.computercraft.shared.common.TileGeneric.func_145844_m(TileGeneric.java:170)
at net.minecraft.server.management.PlayerManager$PlayerInstance.func_151252_a(PlayerManager.java:591)
at net.minecraft.server.management.PlayerManager$PlayerInstance.func_73254_a(PlayerManager.java:533)
at net.minecraft.server.management.PlayerManager.func_72693_b(PlayerManager.java:67)
at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:185)
-- Affected level --
Details:
Level name: world
All players: 1 total; [EntityPlayerMP['t0d'/3431, l='world', x=228.11, y=57.00, z=324.26]]
Chunk stats: ServerChunkCache: 1247 Drop: 0
Level seed: 980211893047677768
Level generator: ID 00 - default, ver 1. Features enabled: true
Level generator options:
Level spawn location: World: (204,64,240), Chunk: (at 12,4,0 in 12,15; contains blocks 192,0,240 to 207,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 7165882 game time, 390294 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 86950 (now: false), thunder time: 18887 (now: false)
Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:625)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Linux (amd64) version 3.16.0-31-generic
Java Version: 1.7.0_75, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 103300656 bytes (98 MB) / 461500416 bytes (440 MB) up to 8572502016 bytes (8175 MB)
JVM Flags: 7 total; -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -Xmx8192M -XX:MaxPermSize=4096M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 67 mods loaded, 67 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.10.85.1291} [Forge Mod Loader] (forge-1.7.10-10.13.2.1291-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.13.2.1291} [Minecraft Forge] (forge-1.7.10-10.13.2.1291-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
appliedenergistics2-core{rv1-stable-1} [AppliedEnergistics2 Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CodeChickenCore{1.0.4.35} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
<CoFH ASM>{000} [CoFH ASM Data Initialization] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
NotEnoughItems{1.0.4.90} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.4.90-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ThaumicTinkerer-preloader{0.1} [Thaumic Tinkerer Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenModsCore{0.6} [OpenModsCore] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
appliedenergistics2{rv1-stable-1} [Applied Energistics 2] (appliedenergistics2-rv1-stable-1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHCore{1.7.10R3.0.0RC5} [CoFH Core] (CoFHCore-[1.7.10]3.0.0RC5-207.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ThermalFoundation{1.7.10R1.0.0RC4} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.0.0RC4-58.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ThermalExpansion{1.7.10R4.0.0RC6} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.0.0RC6-138.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BigReactors{0.4.2A2} [Big Reactors] (BigReactors-0.4.2A2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CarpentersBlocks{3.2.8.6} [Carpenter's Blocks] (Carpenter's Blocks v3.2.8.6 - MC 1.7.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Baubles{1.0.1.10} [Baubles] (Baubles-1.7.10-1.0.1.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Thaumcraft{4.2.3.5} [Thaumcraft] (Thaumcraft-1.7.10-4.2.3.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
TwilightForest{2.3.4} [The Twilight Forest] (twilightforest-1.7.10-2.3.4.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
chisel{2.3.7.34} [Chisel 2] (Chisel2-2.3.7.34.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ComputerCraft{1.73} [ComputerCraft] (ComputerCraft1.73.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded{1.7.10R2.8.0RC8} [MineFactory Reloaded] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
EnderIO{1.7.10-2.2.8.349} [Ender IO] (EnderIO-1.7.10-2.2.8.349.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
EnderZoo{1.7.10-1.0.9.18} [Ender Zoo] (EnderZoo-1.7.10-1.0.9.18.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Waila{1.5.8} [Waila] (Waila-1.5.9_1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
extracells{2.1.37} [ExtraCells] (ExtraCells-1.7.10-2.1.37b45.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ExtraUtilities{1.2.2} [Extra Utilities] (extrautilities-1.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FastCraft{1.19} [FastCraft] (fastcraft-1.19.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
IGWMod{1.1.1-17} [In-Game wiki Mod] (IGW-Mod.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
IronChest{6.0.62.742} [Iron Chest] (ironchest-1.7.10-6.0.62.742-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
JABBA{1.2.1} [JABBA] (Jabba-1.2.1a_1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
LunatriusCore{1.1.2.21} [LunatriusCore] (LunatriusCore-1.7.10-1.1.2.21-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Mantle{1.7.10-0.3.2.jenkins184} [Mantle] (Mantle-1.7.10-0.3.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatAppliedEnergistics{1.7.10R2.8.0RC8} [MFR Compat: Applied Energistics] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatAtum{1.7.10R2.8.0RC8} [MFR Compat: Atum] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatBackTools{1.7.10R2.8.0RC8} [MFR Compat: BackTools] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatBuildCraft{1.7.10R2.8.0RC8} [MFR Compat: BuildCraft] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatChococraft{1.7.10R2.8.0RC8} [MFR Compat: Chococraft] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatExtraBiomes{1.7.10R2.8.0RC8} [MFR Compat: ExtraBiomes] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatForestry{1.7.10R2.8.0RC8} [MFR Compat: Forestry] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatForgeMicroblock{1.7.10R2.8.0RC8} [MFR Compat: ForgeMicroblock] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatIC2{1.7.10R2.8.0RC8} [MFR Compat: IC2] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatMystcraft{1.7.10R2.8.0RC8} [MFR Compat: Mystcraft] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatProjRed{1.7.10R2.8.0RC8} [MFR Compat ProjectRed] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatRailcraft{1.7.10R2.8.0RC8} [MFR Compat: Railcraft] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatRP2{1.7.10R2.8.0RC8} [MFR Compat: RP2] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatSufficientBiomes{1.7.10R2.8.0RC8} [MFR Compat: Sufficient Biomes] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatThaumcraft{1.7.10R2.8.0RC8} [MFR Compat: Thaumcraft] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatThermalExpansion{1.7.10R2.8.0RC8} [MFR Compat: Thermal Expansion] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
TConstruct{1.7.10-1.8.2.build858} [Tinkers' Construct] (TConstruct-1.7.10-1.8.2a.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatTConstruct{1.7.10R2.8.0RC8} [MFR Compat: Tinkers' Construct] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatTwilightForest{1.7.10R2.8.0RC8} [MFR Compat: TwilightForest] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
MineFactoryReloaded|CompatVanilla{1.7.10R2.8.0RC8} [MFR Compat: Vanilla] (MineFactoryReloaded-[1.7.10]2.8.0RC8-86.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Morpheus{1.7.10-1.5.26} [Morpheus] (Morpheus-1.7.10-1.5.26.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
NetherOres{1.7.10R2.3.0RC4} [Nether Ores] (NetherOres-[1.7.10]2.3.0RC4-4.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenMods{0.6} [OpenMods] (OpenModsLib-1.7.10-0.6.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenPeripheralCore{0.5.0} [OpenPeripheralCore] (OpenPeripheral-1.7.10-AIO-1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenPeripheral{0.2.0} [OpenPeripheralAddons] (OpenPeripheral-1.7.10-AIO-1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenBlocks{1.3} [OpenBlocks] (OpenBlocks-1.7.10-1.3.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OCS{1.7.3} [OpenCCSensors] (openccsensors-1.7.3.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenPeripheralIntegration{0.1.0} [OpenPeripheralIntegration] (OpenPeripheral-1.7.10-AIO-1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
PneumaticCraft{1.6.3-65} [PneumaticCraft] (PneumaticCraft-1.7.10-1.6.3-65-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Roguelike{1.3.6} [Roguelike Dungeons] (roguelike-1.7.10-1.3.6.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
simplyjetpacks{1.4.1} [Simply Jetpacks] (SimplyJetpacks-MC1.7.10-1.4.1.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Stackie{1.5.1.30} [Stackie] (Stackie-1.7.10-1.5.1.30-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ThaumicTinkerer{unspecified} [Thaumic Tinkerer] (ThaumicTinkerer-2.5-1.7.10-162.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
TiCTooltips{1.2.3} [TiC Tooltips] (TiCTooltips-mc1.7.10-1.2.3.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
wawla{1.0.9} [What Are We Looking At] (Wawla-1.0.9_1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
OpenModsLib crash transformers: [gl_capabilities_hook:ENABLED],[player_render_hook:ENABLED],[map_gen_fix:FINISHED],[movement_callback:ENABLED],[stencil_patches:ENABLED]
AE2 Version: stable rv1-stable-1 for Forge 10.13.0.1187
CoFHCore: -[1.7.10]3.0.0RC5-207
ThermalFoundation: -[1.7.10]1.0.0RC4-58
ThermalExpansion: -[1.7.10]4.0.0RC6-138
MineFactoryReloaded: -[1.7.10]2.8.0RC8-86
Mantle Environment: Environment healthy.
TConstruct Environment: Environment healthy.
NetherOres: Lacking version information.
AE2 Integration: IC2:OFF, RotaryCraft:OFF, RC:OFF, BC:OFF, MJ6:OFF, MJ5:ON, RF:ON, RFItem:ON, MFR:ON, DSU:ON, FZ:OFF, FMP:OFF, RB:OFF, CLApi:OFF, Mekanism:OFF, ImmibisMicroblocks:OFF, BetterStorage:OFF
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 1 / 20; [EntityPlayerMP['t0d'/3431, l='world', x=228.11, y=57.00, z=324.26]]
Is Modded: Definitely; Server brand changed to 'fml,forge'
Type: Dedicated Server (map_server.txt)
--
-- Control passive cooled Big Reactor (http://big-reactors.com/).
--
-- Author: kla_sch
--
-- History:
-- v0.1, 2014-05-05:
-- first version
--
-- Remarks:
-- Reactor API: http://big-reactors.com/cc_api.html
--
--
-- Constant values (configuration)
--
-- Critical energy mark: give us the maximum power.
critEnergy=3000000
-- Low energy mark: turn reactor on to get more energy
lowEnergy=7000000
-- Heigh energy mark: we have enough, so turn the reactor off.
highEnergy=9000000
--
-- Calculate the control rod level (in %) by stored energy of internal
-- recator cell.
--
-- * If cellEnergy <= critEnergy, the calculation results in maximum
-- energy generation (control rod level = 0%).
-- * If cellEnergy >= highEnergy, the calculation results in 10% energy
-- generation (control rod level = 90%).
--
-- Parameters:
-- cellEnergy - stored energy of internal cell in RF
--
-- Return:
-- New control rod level in %.
--
function calcRodLevel(cellEnergy)
-- Delta between critical and heigh energy mark
local deltaEnergy = highEnergy - critEnergy
-- Calculated maximum delta energy (not the real maximum), so that
-- the high energy mark results into a control rod level of 90%
local deltaEnergy100 = deltaEnergy * 100 / 90
-- Energy for calculation: value between 0 and 'deltaEnergy'
local calcEnergy = cellEnergy - critEnergy
if calcEnergy < 0 then
calcEnergy = 0
elseif calcEnergy > deltaEnergy then
calcEnergy = deltaEnergy
end
-- Calculate control rod level and round the result (math.floor + 0.5)
return math.floor(calcEnergy * 100 / deltaEnergy100 + 0.5)
end
--
-- Write text with colors, if possible (advance monitor)
--
-- Parameters:
-- mon - handle of monitor
-- color - text color
-- text - text to write
--
function writeColor(mon, color, text)
if (mon.isColor()) then
mon.setTextColor(color)
end
mon.write(text)
if (mon.isColor()) then
mon.setTextColor(colors.white)
end
end
--
-- Display reactor status to a monitor.
--
-- Parameters:
-- mon - handle of monitor.
-- state - state of reactor (on/off)
-- rodLvl - Level of control rods in %
-- cellEnergy - stored energy of internal cell (in RF)
--
function displayStatusToMonitor(mon, state, rodLvl, cellEnergy)
mon.clear()
-- First get the monitor size and try to scale, if the feature ist
-- available.
if mon.setTextScale ~= nil then
-- reset text scale
mon.setTextScale(1)
end
local width, height = mon.getSize()
if width < 15 or height < 5 then
-- too small: try to scale down.
if mon.setTextScale ~= nil then
mon.setTextScale(0.5)
else
return -- too small und no text scale available
end
width, height = mon.getSize()
if width < 15 or height < 5 then
return -- still too small
end
else
-- Huge monitors? Try to scale up, if possible (max scale=5).
local scale = math.min(width / 16, height / 5, 5)
scale = math.floor(scale * 2) / 2 -- multiple of 0.5
if scale > 1 and mon.setTextScale ~= nil then
mon.setTextScale(scale)
width, height = mon.getSize()
end
end
--
-- Output the data
--
mon.setCursorPos(1,1)
mon.write("Reactor")
mon.setCursorPos(1,3)
mon.write("Status ")
if state then
writeColor(mon, colors.green, "ON")
else
writeColor(mon, colors.red, "OFF")
end
mon.setCursorPos(1,4)
mon.write("Rod Level: " .. rodLvl .. "%")
mon.setCursorPos(1,5)
if width < 16 then
mon.write("Cell: ") -- One block monitor (15x5 with scale 0.5)
else
mon.write("Energy: ")
end
local c
if cellEnergy < critEnergy then
c = colors.red -- Red: We use too much energy
elseif cellEnergy > lowEnergy then
c = colors.green -- Green: More energy then low water mark
else
c = colors.orange -- Orange: Less energy the low water mark, but OK
end
writeColor(mon, c, string.format("%d", math.floor(cellEnergy/1000 + 0.5)))
mon.write(" kRF")
end
--
-- Display reactor status to any connected monitor and also to console.
--
-- Parameters:
-- state - state of reactor (on/off)
-- rodLvl - Level of control rods in %
-- cellEnergy - stored energy of internal energy cell in RF
--
function displayStatus(state, rodLvl, cellEnergy)
displayStatusToMonitor(term, state, rodLvl, cellEnergy) -- console
term.setCursorPos(1,7)
term.write("* Hold Crtl-T to terminate program")
term.setCursorPos(1,8)
local pList = peripheral.getNames()
local i, name
for i, name in pairs(pList) do
if peripheral.getType(name) == "monitor" then
-- found monitor as peripheral
displayStatusToMonitor(peripheral.wrap(name),
state, rodLvl, cellEnergy)
end
end
end
--
-- Find the first connected big reactor and return the wraped handle.
--
-- If no reactor was found this function terminate the program.
--
-- Return:
-- Handle of first connected reactor found.
--
function getReactorHandle()
local pList = peripheral.getNames()
local i, name
for i, name in pairs(pList) do
if peripheral.getType(name) == "BigReactors-Reactor" then
return peripheral.wrap(name)
end
end
error("No big reactor connected: Exit program")
exit()
end
reactor = getReactorHandle()
--
-- Endless loop: Recalculate rod level, set rod level, display result
-- and wait for 5 secounds.
--
while true do
cellEnergy = reactor.getEnergyStored()
if cellEnergy < lowEnergy then
-- Low energy: switch reactor ON and calculate control rods by
-- energy cell level.
reactor.setActive(true)
rodLvl=calcRodLevel(cellEnergy)
elseif cellEnergy > highEnergy then
-- High energy: switch reactor OFF and set control rod level to 100
reactor.setActive(false)
rodLvl=100
elseif cellEnergy > lowEnergy then
-- Enough energy: do not change state of reactor. Only recalculate
-- control rod level.
--
-- * If the reactor ist switched off, we will wait until energy
-- fall below low energy mark.
--
-- * If it is turned on, we generate more energy until the
-- energy level exeeds the high energy mark.
rodLvl=calcRodLevel(cellEnergy)
end
reactor.setAllControlRodLevels(rodLvl)
displayStatus(reactor.getActive(), rodLvl, cellEnergy)
os.sleep(5) -- Wait for 5s
end
--
-- EOF
--