Advertisement
therealinsight

Untitled

May 3rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 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("back")
  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("forward")
  16.     rednet.broadcast("sendmail")
  17.     write("To: (in ID) ")
  18.     input = read()
  19.     rednet.broadcast("forward")
  20.     rednet.broadcast(input)
  21.     print("Message body:")
  22.     input = read()
  23.     rednet.broadcast("forward")
  24.     rednet.broadcast(input)
  25.     else
  26.         print("Usage:")
  27.     print("mail read (mailid)")
  28.         print("mail send")
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement