SHOW:
|
|
- or go back to the newest paste.
| 1 | rednet.open("top")
| |
| 2 | while true do | |
| 3 | local status = rs.getInput("left")
| |
| 4 | if status == false then | |
| 5 | sender = "OFF" | |
| 6 | else | |
| 7 | sender = "ON" | |
| 8 | end | |
| 9 | ||
| 10 | to, msg, prtc = rednet.receive() | |
| 11 | if msg == "STATUS" then | |
| 12 | rednet.send(to, sender) | |
| 13 | print("STATUS")
| |
| 14 | elseif msg == "OFF" then | |
| 15 | rs.setOutput("left", false)
| |
| 16 | print("OFF")
| |
| 17 | elseif msg == "ON" then | |
| 18 | rs.setOutput("left", true)
| |
| 19 | print("ON")
| |
| 20 | end | |
| 21 | end |