This is the code so far, im close to make it works, the problem now is this; when it do not detect redstone on the main room, it does jump to the next check, and check if there is redstone on the next room, however when it does detect the signal on the first room, it do not check for the messages that comes from the second room, i dont have a clue what im doing wrong, i try to use 'while/do' instead of 'if/then' and replace 'else' for other stuff it aint work.
term.clear()
monitor = peripheral.wrap("top")
monitor.setBackgroundColor(colors.black)
monitor.clear()
monitor.setTextColor(colors.lightBlue)
monitor.setCursorPos(3,1)
monitor.write("Oxygen Central")
monitor.setTextColor(colors.white)
monitor.setCursorPos(1,3)
monitor.write("Main Control")
monitor.setCursorPos(1,4)
monitor.write("Oxygen Module")
term.setCursorPos(1,1)
print("OXYGEN SYSTEMS")
while true do
redstone = rs.getInput("right")
if rs.getInput("right") == true then
monitor.setCursorPos(15,3)
monitor.setBackgroundColor(colors.lime)
monitor.write("ON ")
sleep(1)
else
redstone = rs.getInput("right")
if rs.getInput("right") == false then
monitor.setCursorPos(15,3)
monitor.setBackgroundColor(colors.red)
monitor.write("OFF")
sleep(1)
rednet.open("left")
local id, message = rednet.receive()
if message == "o1" then
monitor.setCursorPos(15,4)
monitor.setBackgroundColor(colors.blue)
monitor.write("ON ")
sleep(1)
else
if message == "o1n" then
monitor.setCursorPos(15,4)
monitor.setBackgroundColor(colors.red)
monitor.write("OFF")
sleep(1)
end
end
end
end
end
same code on Raw paste data:
term.clear()
monitor = peripheral.wrap("top")
monitor.setBackgroundColor(colors.black)
monitor.clear()
monitor.setTextColor(colors.lightBlue)
monitor.setCursorPos(3,1)
monitor.write("Oxygen Central")
monitor.setTextColor(colors.white)
monitor.setCursorPos(1,3)
monitor.write("Main Control")
monitor.setCursorPos(1,4)
monitor.write("Oxygen Module")
term.setCursorPos(1,1)
print("OXYGEN SYSTEMS")
while true do
redstone = rs.getInput("right")
if rs.getInput("right") == true then
monitor.setCursorPos(15,3)
monitor.setBackgroundColor(colors.lime)
monitor.write("ON ")
sleep(1)
else
redstone = rs.getInput("right")
if rs.getInput("right") == false then
monitor.setCursorPos(15,3)
monitor.setBackgroundColor(colors.red)
monitor.write("OFF")
sleep(1)
rednet.open("left")
local id, message = rednet.receive()
if message == "o1" then
monitor.setCursorPos(15,4)
monitor.setBackgroundColor(colors.blue)
monitor.write("ON ")
sleep(1)
else
if message == "o1n" then
monitor.setCursorPos(15,4)
monitor.setBackgroundColor(colors.red)
monitor.write("OFF")
sleep(1)
end
end
end
end
end
i forgot to mentionate that there is another computer sending those messages, it send message 'o1' when it have a redstone signal and the message 'o1n' when it dont