Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- lato = "front"
- rs.setOutput(lato, false)
- while true do
- local id, msg, ptrc = rednet.receive()
- inp = rs.getInput(lato)
- if msg == "status" then
- print("SATTUS")
- if inp == false then
- rednet.send(id, "ON")
- elseif inp == true then
- rednet.send(id, "OFF")
- else
- rednet.send(id, "ERROR")
- end
- elseif msg == "ON" then
- rs.setOutput(lato, false)
- else
- rs.setOutput(lato, true)
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement