Guest User

msg

a guest
Jul 26th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2.  
  3. shell.run("clear")
  4. print("What would you like to say?")
  5. print(" ")
  6. newmsg = read()
  7. modem.transmit(68,69,newmsg)
  8. modem.open(69)
  9. shell.run("clear")
  10. print("Your message has been sent!")
  11. event, side, chan, rchan, msg, dist = os.pullEvent("modem_message")
  12. if msg == "Received!" then
  13.   print("Your message has been received!")
  14. else
  15.   print("An invalid message has been returned.")
  16.   print("Your message probably has not been received.")
  17. end
  18. sleep(2)
  19. print(" ")
  20. print("Rebooting...")
  21. sleep(3)
  22. shell.run("reboot")
Advertisement
Add Comment
Please, Sign In to add comment