SHOW:
|
|
- or go back to the newest paste.
1 | mon = peripheral.wrap("right") | |
2 | ||
3 | - | for i, side in ipairs(rs.getSides()) do --#Loop for each side on the computer that redstone can be used, these can also be used by modems. |
3 | + | if peripheral.getType("up") == 'modem' then --#Did we find a modem... Or some other peripheral? |
4 | - | if peripheral.getType(side) == 'modem' then --#Did we find a modem... Or some other peripheral? |
4 | + | |
5 | --print("Found Modem On Side up!") | |
6 | - | --print('Found Modem On Side '..side.."!") |
6 | + | rednet.open("up") |
7 | - | rednet.open(side) |
7 | + | wireless = peripheral.wrap("up") |
8 | - | wireless = peripheral.wrap(side) |
8 | + | |
9 | - | break --#Opened modem, dont open any others. |
9 | + | |
10 | function waitForMessage(displayMessage) | |
11 | local sender, message, protocol = rednet.receive() | |
12 | if displayMessage then | |
13 | mon.clear() | |
14 | local w, h = term.getSize() | |
15 | mon.setCursorPos(1,1) | |
16 | mon.write(message) | |
17 | else | |
18 | return message | |
19 | end | |
20 | end | |
21 | ||
22 | while true do | |
23 | waitForMessage(true) | |
24 | end |