Advertisement
PCKid11

ComputerCraft eMail V2

Jun 17th, 2012
6,853
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1.     -- This is my ComputerCraft eMail client code.
  2.     -- if you want the server, goto http://pastebin.com/FC1Lp6qH
  3.     local tArgs = { ... }
  4.     rednet.open("right")
  5.     if tArgs[1] == "read" then
  6.     rednet.broadcast(tArgs[2])
  7.     a, messagep = rednet.receive(1)
  8.     if messagep == null then
  9.     else
  10.     print("You've Got Mail!")
  11.     print("------------------")
  12.     print(messagep)
  13.     end
  14.     else if tArgs[1] == "send" then
  15.     rednet.broadcast("sendmail")
  16.     write("To: (in ID) ")
  17.     input = read()
  18.     rednet.broadcast(input)
  19.     print("Message body:")
  20.     input = read()
  21.     rednet.broadcast(input)
  22.     else
  23.     print("Usage:")
  24.     print("mail read (mailid)")
  25.     print("mail send")
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement