Advertisement
bennyuoppd

CC Mail v2

Aug 11th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. rednet.open("top")
  2. rednet.open("bottom")
  3. rednet.open("left")
  4. rednet.open("right")
  5. rednet.open("front")
  6. rednet.open("back")
  7. rednet.broadcast("readmail")
  8. a, messagep = rednet.receive(1)
  9. if messagep == null then
  10. else
  11. print("You've Got Mail!")
  12. print("------------------")
  13. print(messagep)
  14. end
  15. write("Do you want to send mail?")
  16. input = read()
  17. if input == "yes" then
  18. rednet.broadcast("sendmail")
  19. write("To: (ID) ")
  20. input = read()
  21. rednet.broadcast(input)
  22. input = os.getComputerLabel()
  23. write("From: " .. os.getComputerLabel())
  24. rednet.broadcast(input)
  25. print("Message body:")
  26. input = read()
  27. rednet.broadcast(input)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement