Posted 08 September 2014 - 01:21 AM
Here is the code ive been working on, it all works fine apart from redstone signal only emits if turbine 2 is offline and not when any of them go offline. could you please have a look and see what ive done wrong
local reactor1 = peripheral.wrap("BigReactors-Reactor_1")
local turbine1 = peripheral.wrap("BigReactors-Turbine_1")
local reactor2 = peripheral.wrap("BigReactors-Reactor_2")
local turbine2 = peripheral.wrap("BigReactors-Turbine_2")
local ec1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
local mon1 = peripheral.wrap("left")
local mon2 = peripheral.wrap("right")
while true do
sleep(0.5)
mon1.clear()
mon1.setTextScale(0.5)
mon2.clear()
mon2.setTextScale(0.5)
mon1.setCursorPos(1,1)
mon1.setTextColor(colors.white)
mon1.write("Reactor: ")
if reactor1.getActive (true) then
mon1.setTextColor(colors.lime)
mon1.write("Online")
redstone.setOutput ("top",false)
else
mon1.setTextColor(colors.red)
mon1.write("Offline")
redstone.setOutput ("top",true)
end
mon1.setCursorPos(1,2)
mon1.setTextColor(colors.white)
mon1.write("Turbine: ")
if turbine1.getActive (true) then
mon1.setTextColor(colors.lime)
mon1.write("Online")
redstone.setOutput ("top",false)
else
mon1.setTextColor(colors.red)
mon1.write("Offline")
redstone.setOutput ("top",true)
end
mon1.setCursorPos(1,4)
mon1.setTextColor(colors.white)
mon1.write("Power (RF/T): ")
mon1.setTextColor(colors.lime)
mon1.write(turbine1.getEnergyProducedLastTick())
mon1.setCursorPos(1,5)
mon1.setTextColor(colors.white)
mon1.write("Stored RF: ")
mon1.setTextColor(colors.lime)
mon1.write(turbine1.getEnergyStored())
mon1.setCursorPos(1,6)
mon1.setTextColor(colors.white)
mon1.write("Rotor Speed (RPM): ")
mon1.setTextColor(colors.lime)
mon1.write(turbine1.getRotorSpeed())
mon2.setCursorPos(1,1)
mon2.setTextColor(colors.white)
mon2.write("Reactor: ")
if reactor2.getActive (true) then
mon2.setTextColor(colors.lime)
mon2.write("Online")
redstone.setOutput ("top",false)
else
mon2.setTextColor(colors.red)
mon2.write("Offline")
redstone.setOutput ("top",true)
end
mon2.setCursorPos(1,2)
mon2.setTextColor(colors.white)
mon2.write("Turbine: ")
if turbine2.getActive (true) then
mon2.setTextColor(colors.lime)
mon2.write("Online")
redstone.setOutput ("top",false)
else
mon2.setTextColor(colors.red)
mon2.write("Offline")
redstone.setOutput ("top",true)
end
mon2.setCursorPos(1,4)
mon2.setTextColor(colors.white)
mon2.write("Power (RF/T):")
mon2.setTextColor(colors.lime)
mon2.write(turbine2.getEnergyProducedLastTick())
mon2.setCursorPos(1,5)
mon2.setTextColor(colors.white)
mon2.write("Stored RF: ")
mon2.setTextColor(colors.lime)
mon2.write(turbine2.getEnergyStored())
mon2.setCursorPos(1,6)
mon2.setTextColor(colors.white)
mon2.write("Rotor Speed (RPM): ")
mon2.setTextColor(colors.lime)
mon2.write(turbine2.getRotorSpeed())
end