SHOW:
|
|
- or go back to the newest paste.
1 | rednet.open("top") | |
2 | while true do | |
3 | message=0 | |
4 | - | if rs.getInput("left") and rs.getInput("back") then |
4 | + | |
5 | - | rs.setOutput("front",true) |
5 | + | |
6 | - | else |
6 | + | print("do you want to resive or send message?") |
7 | - | rs.setOutput("front",false) |
7 | + | print("1 for send and 2 for resive") |
8 | a=read() | |
9 | a=tonumber(a) | |
10 | ||
11 | if a==1 then | |
12 | print("type in your message") | |
13 | msg=read() | |
14 | rednet.broadcast(msg) | |
15 | end | |
16 | ||
17 | if a==2 then | |
18 | print("waiting for the message") | |
19 | while message == 0 do | |
20 | id,message=rednet.receive() | |
21 | print("here is your message") | |
22 | print(message) | |
23 | end | |
24 | end | |
25 | end |