Posted 10 August 2012 - 07:06 PM
hi,
i am trying to have a monitor showing the temperature of my nuclear reactor. so far i have a "MFFS reactor heat monitor server" and 3 "MFFS reactor heat monitor client" connetected to bundledcable colors like this:
white - reactor on
green - reactor 6000+
red - reactor 9000+
black - reactor 11000+
and i have this code on the computer:
my problem is that if for example reactor is 9000+ the colors white, green and red will be on and the computer will detect only the white one.
Is there any way i can have some priority like black > red > green > white so that it will print only the latest signal.
Sorry if i couldn't explain what i want, i've been looking at this for a while now lol
i am trying to have a monitor showing the temperature of my nuclear reactor. so far i have a "MFFS reactor heat monitor server" and 3 "MFFS reactor heat monitor client" connetected to bundledcable colors like this:
white - reactor on
green - reactor 6000+
red - reactor 9000+
black - reactor 11000+
and i have this code on the computer:
local monitorSide = "right"
local cableSide = "bottom"
state = "REACTOR OFF "
heat = "COLD "
if peripheral.isPresent(monitorSide) and peripheral.getType(monitorSide) == "monitor" then
-- redirect terminal output to the monitor
term.redirect(peripheral.wrap(monitorSide))
else
-- no monitor, exit
print("No monitor found")
return
end
while true do
term.setCursorPos(3,2)
print(state)
term.setCursorPos(4,4)
print(heat)
os.pullEvent("redstone")
if rs.testBundledInput("bottom", colors.white) == true then
state = "REACTOR ON "
elseif rs.testBundledInput("bottom", colors.white) == false then
state = "REACTOR OFF "
elseif rs.testBundledInput("bottom", colors.green) == true then
heat = "HOT "
elseif rs.testBundledInput("bottom", colors.green) == false then
heat = "COLD "
elseif rs.testBundledInput("bottom", colors.red) then
heat = "OVERHEATING"
elseif rs.testBundledInput("bottom", colors.black) then
state = "SHUTTINGDOWN"
else
state = "failed"
end
end
my problem is that if for example reactor is 9000+ the colors white, green and red will be on and the computer will detect only the white one.
Is there any way i can have some priority like black > red > green > white so that it will print only the latest signal.
Sorry if i couldn't explain what i want, i've been looking at this for a while now lol