Advertisement
Guest User

startup

a guest
Aug 21st, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  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())
  16.   local id = sworninput1
  17.   print("Then type the message you want to send!")
  18.   print("Message:")
  19.   sworninput2 = read()
  20.   local msg = sworninput2
  21.   os.sleep(0.1)
  22.   rednet.send(id,msg)  
  23. end
  24.  
  25. while true do
  26.   local input=""
  27.   print("Rednet Communication Serive (RCS) active")
  28.   print("To broadcast, type 'bc'")
  29.   print("To send a message to a specific ID, type 'msg'")  
  30.   input = read()
  31.   if input == "bc" then
  32.     broadcastOverRN()
  33.   else
  34.     if input == "msg" then
  35.       sendMessageOverRN()
  36.     else
  37.       print("You seem to be very dumb")
  38.       print("Can't handle such stupidness!")
  39.       os.sleep(1)
  40.       print("Rebooting now :P")
  41.       os.sleep(1)
  42.     end
  43.   end
  44.   os.sleep(0.2)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement