SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- This is my ComputerCraft eMail client code. |
| 1 | + | rednet.open("right")
|
| 2 | - | -- if you want the server, goto http://pastebin.com/FC1Lp6qH |
| 2 | + | rednet.broadcast("readmail")
|
| 3 | - | local tArgs = { ... }
|
| 3 | + | a, messagep = rednet.receive(1) |
| 4 | - | rednet.open("right")
|
| 4 | + | if messagep == null then |
| 5 | - | if tArgs[1] == "read" then |
| 5 | + | else |
| 6 | - | rednet.broadcast(tArgs[2]) |
| 6 | + | print(" Mail Received!")
|
| 7 | - | a, messagep = rednet.receive(1) |
| 7 | + | print("+--------------+")
|
| 8 | - | if messagep == null then |
| 8 | + | print(messagep) |
| 9 | - | else |
| 9 | + | |
| 10 | - | print("You've Got Mail!")
|
| 10 | + | write("Compose new email?")
|
| 11 | - | print("------------------")
|
| 11 | + | input = read() |
| 12 | - | print(messagep) |
| 12 | + | if input == "yes" then |
| 13 | - | end |
| 13 | + | rednet.broadcast("sendmail")
|
| 14 | - | else if tArgs[1] == "send" then |
| 14 | + | write("To: (in ID) ")
|
| 15 | - | rednet.broadcast("sendmail")
|
| 15 | + | input = read() |
| 16 | - | write("To: (in ID) ")
|
| 16 | + | rednet.broadcast(input) |
| 17 | - | input = read() |
| 17 | + | print("Message body:")
|
| 18 | - | rednet.broadcast(input) |
| 18 | + | input = read() |
| 19 | - | print("Message body:")
|
| 19 | + | rednet.broadcast(input) |
| 20 | - | input = read() |
| 20 | + |