View difference between Paste ID: 8W1SrQrH and Ka8RfPHg
SHOW: | | - or go back to the newest paste.
1
rednet.open("back")
2
3
function broadcastOverRN()
4
  local bcinput=""
5
  print("Type the message you want to broadcast it")
6
  print("over Rednet!")
7
  bcinput = read()
8
  rednet.broadcast(bcinput)
9
end
10
11
function sendMessageOverRN()
12
  --local smorninput1=""
13
  print("First, type the ID you want to send the meassage to!")
14
  print("ID:")
15-
  smorninput1 =tonumber(read())
15+
  smorninput1 = tonumber(read())
16-
  local id = sworninput1
16+
  for i=0,1000 do
17
    if sworninput1 == i then
18
      local id = i
19
    end 
20
  end
21
  print("Then type the message you want to send!")
22
  print("Message:")
23
  sworninput2 = read()
24
  local msg = sworninput2
25
  os.sleep(0.1)
26
  rednet.send(id,msg)  
27
end
28
29
while true do
30
  local input=""
31
  print("Rednet Communication Serive (RCS) active")
32
  print("To broadcast, type 'bc'")
33
  print("To send a message to a specific ID, type 'msg'")  
34
  input = read()
35
  if input == "bc" then
36
    broadcastOverRN()
37
  else
38
    if input == "msg" then
39
      sendMessageOverRN()
40
    else
41
      print("You seem to be very dumb")
42
      print("Can't handle such stupidness!")
43
      os.sleep(1)
44
      print("Rebooting now :P")
45
      os.sleep(1)
46
    end
47
  end
48
  os.sleep(0.2)
49
end