Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ID : 2
- local mon = peripheral.wrap("back")
- local i = 0
- rednet.open("right")
- mon.setTextScale(1)
- mon.clear()
- mon.setTextColor(colors.black)
- mon.setCursorPos(2,4)
- mon.setBackgroundColor(colors.green)
- mon.write(" ")
- mon.setCursorPos(2,5)
- mon.setBackgroundColor(colors.green)
- mon.write(" On ")
- mon.setCursorPos(2,6)
- mon.setBackgroundColor(colors.green)
- mon.write(" ")
- mon.setCursorPos(10,4)
- mon.setBackgroundColor(colors.red)
- mon.write(" ")
- mon.setCursorPos(10,5)
- mon.setBackgroundColor(colors.red)
- mon.write(" Auto ")
- mon.setCursorPos(10,6)
- mon.setBackgroundColor(colors.red)
- mon.write(" ")
- mon.setBackgroundColor(colors.black)
- while true do
- local event, side, sCh, rCh, msg, dist = os.pullEvent()
- if event == "modem_message" then
- local ID, Message, Protocole = rednet.receive()
- if (Protocole == "Etat") and (Message == "On") then
- mon.setCursorPos(1,1)
- mon.write(" ")
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.green)
- mon.write("Reacteur On")
- elseif (Protocole == "Etat") and (Message == "Off") then
- mon.setCursorPos(1,1)
- mon.write(" ")
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write("Reacteur Off")
- end
- if (Protocole == "Prod") then
- mon.setCursorPos(1,2)
- mon.write(" ")
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.orange)
- mon.write("Production :"..Message.." RF/t")
- end
- if (Protocole == "Stor") then
- mon.setCursorPos(1,3)
- mon.write(" ")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.magenta)
- mon.write("Stoquage :"..Message.." RF")
- end
- if (ID == 4) and (Message == "Auto") then
- i = 0
- elseif (ID == 4) and (Message == "Man") then
- i = 1
- end
- end
- if i == 0 then
- mon.setCursorPos(14,1)
- mon.setTextColor(colors.yellow)
- mon.write(" ")
- mon.setCursorPos(14,1)
- mon.write("Mode : Auto")
- else
- mon.setCursorPos(14,1)
- mon.setTextColor(colors.yellow)
- mon.write(" ")
- mon.setCursorPos(14,1)
- mon.write("Mode : Active")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement