SHOW:
|
|
- or go back to the newest paste.
| 1 | rednet.open("left")
| |
| 2 | ||
| 3 | - | rs.setOutput("right", false)
|
| 3 | + | lato = "front" |
| 4 | ||
| 5 | rs.setOutput(lato, false) | |
| 6 | ||
| 7 | - | inp = rs.getInput("right")
|
| 7 | + | |
| 8 | local id, msg, ptrc = rednet.receive() | |
| 9 | inp = rs.getInput(lato) | |
| 10 | if msg == "status" then | |
| 11 | print("SATTUS")
| |
| 12 | if inp == false then | |
| 13 | rednet.send(id, "ON") | |
| 14 | elseif inp == true then | |
| 15 | rednet.send(id, "OFF") | |
| 16 | else | |
| 17 | rednet.send(id, "ERROR") | |
| 18 | - | rs.setOutput("right", false)
|
| 18 | + | |
| 19 | elseif msg == "ON" then | |
| 20 | - | rs.setOutput("right", true)
|
| 20 | + | rs.setOutput(lato, false) |
| 21 | else | |
| 22 | rs.setOutput(lato, true) | |
| 23 | end | |
| 24 | sleep(0.1) | |
| 25 | end |