SHOW:
|
|
- or go back to the newest paste.
| 1 | for a, b in pairs (rs.getSides()) do | |
| 2 | if peripheral.getType(b) == "modem" then | |
| 3 | rednet.open(b) | |
| 4 | end | |
| 5 | end | |
| 6 | ||
| 7 | day = "left" | |
| 8 | night = "right" | |
| 9 | clear = "top" | |
| 10 | rain = "front" | |
| 11 | storm = "bottom" | |
| 12 | ||
| 13 | function _rsOutput(side) | |
| 14 | print("Command Received: \""..message.."\"")
| |
| 15 | rs.setOutput(side, true) | |
| 16 | sleep(1) | |
| 17 | rs.setOutput(side, false) | |
| 18 | end | |
| 19 | ||
| 20 | while true do | |
| 21 | id, message = rednet.receive() | |
| 22 | if message == "SET_TO_DAY" then | |
| 23 | _rsOutput(day) | |
| 24 | elseif message == "SET_TO_NIGHT" then | |
| 25 | _rsOutput(night) | |
| 26 | elseif message == "SET_TO_CLEAR" then | |
| 27 | _rsOutput(clear) | |
| 28 | elseif message == "SET_TO_RAIN" then | |
| 29 | _rsOutput(rain) | |
| 30 | elseif message == "SET_TO_STORM" then | |
| 31 | _rsOutput(storm) | |
| 32 | elseif message == "PRINT_SIDES" then | |
| 33 | rednet.send(74, "Day is "..day) | |
| 34 | rednet.receive() | |
| 35 | rednet.send(74, "Night is "..night) | |
| 36 | rednet.receive() | |
| 37 | rednet.send(74, "Clear is "..clear) | |
| 38 | rednet.receive() | |
| 39 | rednet.send(74, "Rain is "..rain) | |
| 40 | rednet.receive() | |
| 41 | rednet.send(74, "Storm is "..storm) | |
| 42 | end | |
| 43 | end |