This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TCGM's profile picture

TCMail - Successor to ComputerCraft eMail

Started by TCGM, 09 July 2012 - 05:44 PM
TCGM #1
Posted 09 July 2012 - 07:44 PM
TCMail - Fully Functional Email


SO, after several days of non-stop trial and error, bugfixing, tweaking, rewriting, and asking annoying questions on these very forums, I'm proud to be done with the first version of TCMail.

TCMail is an OS-Independent mail system utilizing a central processing server and a client set of programs. Its capabilities include:
-Database storage of names, emails, custom names, and etc.
-Linking of Computer IDs to these names, done automatically.
-Ability to send an email to any name or ID registered (and have it go to the correct place).
-Time-independent mail retrieval (the email is still there if the server restarts and can still be picked up).
-Saving and loading of the previously mentioned database.
-Username checking; will not allow duplicate usernames or computer names on the network.
-Automatic Registration.
-And more!

I've written a very user-friendly install system, which will even add the necessary code onto your current OS in order to allow OS independence. The singular install system can install all 3 versions of TCMail (Admin, Client, and Server).

BIG FLASHY WARNING SIGN THAT YOU WILL DEFINITELY READ:
You MUST have a modem on the right side of the computer in order for TCMail to function correctly!

DOWNLOAD:
[attachment=302:TCMail 1.zip]

SCREENSHOTS:
Spoiler









































Installation Instructions (external, not ingame!):
1. Download the attached zip folder.
2. Unzip the zip folder.
3. Select the "Disk" folder inside the unzipped folder and hit CTRL+C (or whatever the stupid mac equivalent is).
4. Navigate to your world folder you will be installing TCMail in.
4a. If this is in singeplayer:
1. Open the start menu.
2. Type in "run" or if you are not a noob to this, open up run.
3. Type in %appdata%. Hit enter.
4. Depending upon whether you installed CC normally, or it is a part of technic or tekkit, go to the following folders:
Minecraft: ".minecraft"
Tekkit: ".techniclauncher/tekkit"
Technic: ".techniclaunher/technic"
5. Locate the "saves" folder inside the folder you went to. Open it.
6. Open up the folder with the name of your world.
7. Open up the "computer" folder.
8. Keep this on the side of your screen. Open up minecraft.
9. Go into your world. Grab yourself a BLANK floppy disk.
10. Open up a computer with an attached Disk Drive. Put the floppy IN the Disk Drive.
11. On the computer, type, without the quotes, "label set disk TCMail".
12. Once that is completed, take out the floppy disk. Hover your mouse over the disk. Note the number after the colon on the window that pops up. That is important! Write it down. Or remember it.
13. Go back to the folder we had open earlier. Inside the "computer" folder, there is a folder called "disk". Open it.
14. Inside THAT folder there should be at least 1 numbered folder. Locate the folder whose name is the number you wrote down earlier, and open it.
15. Go to the other window you had open with the unzipped file loaded in it. Copy the entire contents of the TCMail "Disk" folder into the numbered folder. Go back ingame.
16. Put the floppy disk in the drive on the computer you would like to install TCMail on.
17. Type "reboot", without quotes, into the computer. The computer will reboot and bring up the TCMail installation system.
18. Follow the directions in the installer!
4b. If this is in multiplayer, have your local server admin follow these steps.

Credits/Shoutouts:
Kudos to Pinkishu and MysticT, for putting up with my incessant questions and giving me excellent help.
MysticT: Beginnings of Loading Code
Pinkishu: Table Code
Credit for the original code which I built off of and gutted goes to PCKid11. Topic: http://www.computerc...tercraft-email/
TCGM #2
Posted 09 July 2012 - 07:46 PM
Reserved.
libraryaddict #3
Posted 09 July 2012 - 08:17 PM
Hmm.
My first suggestion is to make the installation easier then a giant wall of text.

For instance.
"Just run: pastebin get p98yh0p89uh Installer"
"Then run "Installer" and follow instructions"
"You are done!"
Jackster #4
Posted 09 July 2012 - 08:31 PM
Having a play.

Only reason for disk is if you remove the computer I guess?
TCGM #5
Posted 10 July 2012 - 05:01 AM
Hmm.
My first suggestion is to make the installation easier then a giant wall of text.

For instance.
"Just run: pastebin get p98yh0p89uh Installer"
"Then run "Installer" and follow instructions"
"You are done!"

I created the installation instructions for complete idiots. I literally explained EVERY step. I assumed a regular installation instruction set wasn't needed for other people. If you'd like though:

1. Create labelled floppy disk named TCMail using label set disk name, where name is the disk name. Note the number of the disk (the one after the colon ( : ))
2. Navigate to your world folder. Open the computer folder, then the disk folder in it. Open the folder with the number of the TCMail floppy disk.
3. Copy the contents of the "Disk" folder of TCMail into this folder.
4. Insert floppy disk into disk drive ingame, and reboot the computer.
5. Follow the installation.
Lyqyd #6
Posted 10 July 2012 - 07:38 AM
The number of the disk isn't visible with just ComputerCraft installed. These instructions rely on a TMI/NEI-type inventory mod.
BigSHinyToys #7
Posted 10 July 2012 - 11:06 AM
The number of the disk isn't visible with just ComputerCraft installed. These instructions rely on a TMI/NEI-type inventory mod.

1. Create labelled floppy disk named TCMail using label set disk name, where name is the disk name. Note the number of the disk (the one after the colon ( : ))
you can get the number from the name list "labels.txt" in disk folder.
TCGM #8
Posted 10 July 2012 - 04:00 PM
Having a play.

Only reason for disk is if you remove the computer I guess?

The disk install instructions are for server admins who might want to mass-install this program on their server for a server-wide email system that works.

I'm also amazed that people are poking holes in my instructions. Seriously. I see quite a few programs in this subforum devoid of any instructions whatsoever. I can't know every possible install path! T_T
libraryaddict #9
Posted 10 July 2012 - 07:49 PM
Having a play.

Only reason for disk is if you remove the computer I guess?

The disk install instructions are for server admins who might want to mass-install this program on their server for a server-wide email system that works.

I'm also amazed that people are poking holes in my instructions. Seriously. I see quite a few programs in this subforum devoid of any instructions whatsoever. I can't know every possible install path! T_T

You assume we are morons.
You also assume we know exactly how to install a program we did not create
TCGM #10
Posted 11 July 2012 - 12:09 AM
Having a play.

Only reason for disk is if you remove the computer I guess?

The disk install instructions are for server admins who might want to mass-install this program on their server for a server-wide email system that works.

I'm also amazed that people are poking holes in my instructions. Seriously. I see quite a few programs in this subforum devoid of any instructions whatsoever. I can't know every possible install path! T_T

You assume we are morons.
You also assume we know exactly how to install a program we did not create
1. Where did I state I assumed you were morons? I wrote the instructions for complete idiots because, imo, when writing in that style, you provide the most complete instruction set that can be conceived for the aim of the instructions.
2. Again; So do most of the programs in this subforum. And no, I do not assume you know how to install it, thus the instructions.
howlerleeches #11
Posted 19 July 2012 - 10:23 PM
I've set this up on my SMP and it works well, range permitting. Thing is, I only just started playing with ComputerCraft a couple days ago, so I'm not totally sure what I'm doing and I've got a large area in my world that I want my email system to cover. Is there some way I can close the gap between computers, without increasing the wireless modem range in the cfg? I've tried a few different repeater programs, but they don't seem to work, or I'm just not setting those up right. Is it that I need to edit TCMail to work with a repeater? I've also tried using bundled cable, but that just seems to make the emails and registrations buggy.
TCGM #12
Posted 22 July 2012 - 09:28 PM
I haven't truly messed around with repeater programs yet. I believe the issue is that the server records the ID of the sending computer when it receives a message, thus rendering repeater computers useless, unless there is a way to spoof the ID of another computer. I can try messing around with having the server listen for an ID message instead of using the actual ID, and having the client send the ID in a rednet broadcast. Could take a couple days though. If I get it working, I'll upload the relay program as well.

As to your question about the cables; There has to be a direct connection between a computer and the server.
Klausar #13
Posted 23 July 2012 - 03:53 PM
Could you post screenshots?
TCGM #14
Posted 25 July 2012 - 11:12 AM
Could you post screenshots?

Done.
Noodle #15
Posted 25 July 2012 - 11:15 AM
Works but your modem range on server has to be GIGANTIC.
tfoote #16
Posted 25 July 2012 - 06:03 PM
I haven't truly messed around with repeater programs yet. I believe the issue is that the server records the ID of the sending computer when it receives a message, thus rendering repeater computers useless, unless there is a way to spoof the ID of another computer. I can try messing around with having the server listen for an ID message instead of using the actual ID, and having the client send the ID in a rednet broadcast. Could take a couple days though. If I get it working, I'll upload the relay program as well.

As to your question about the cables; There has to be a direct connection between a computer and the server.

Repeter programs are quite easy. I have it so my e-mails get computer handled many times. you don't loose any data and it works great. you just make it so that when it comes in, it goes out
mattp #17
Posted 02 August 2012 - 10:11 PM
The things I had trouble with was how to check mail and how to send it, when sending mail I enter the computer id then hit enter and enter the message but no matter what I do I have no confirmation whether it sent. Pleas help me.
TCGM #18
Posted 03 August 2012 - 08:41 AM
The things I had trouble with was how to check mail and how to send it, when sending mail I enter the computer id then hit enter and enter the message but no matter what I do I have no confirmation whether it sent. Pleas help me.

There MUST be an actively running TCMail server in wireless range, and there must be a rednet modem on the right side of the computer. Without both these, mail will not send.
mattp #19
Posted 03 August 2012 - 06:38 PM
The things I had trouble with was how to check mail and how to send it, when sending mail I enter the computer id then hit enter and enter the message but no matter what I do I have no confirmation whether it sent. Pleas help me.

There MUST be an actively running TCMail server in wireless range, and there must be a rednet modem on the right side of the computer. Without both these, mail will not send.

my question was how do I finalize the send after I typed the message I would try typing send hitting enter and a ton of other stuff but it never said "sent" I have everything you described. Also what is the command to check mail?
TCGM #20
Posted 04 August 2012 - 04:45 PM
The things I had trouble with was how to check mail and how to send it, when sending mail I enter the computer id then hit enter and enter the message but no matter what I do I have no confirmation whether it sent. Pleas help me.

There MUST be an actively running TCMail server in wireless range, and there must be a rednet modem on the right side of the computer. Without both these, mail will not send.

my question was how do I finalize the send after I typed the message I would try typing send hitting enter and a ton of other stuff but it never said "sent" I have everything you described. Also what is the command to check mail?

I never programmed the system for message send confirmation, so when you hit enter, it should just go back to a command prompt and send the message. When you type "mail", the mail program auto-checks to see if you have an awaiting message, and if you do, it displays it.
Cr33per #21
Posted 08 August 2012 - 04:57 PM
Please put code on pastebin
BigSHinyToys #22
Posted 08 August 2012 - 06:18 PM
Please put code on pastebin
Nothing stoping you doing that for personal use only I'm shore would be fine.
http://pastebin.com/
Cr33per #23
Posted 08 August 2012 - 07:03 PM
thanks I want to use it for my server
;)/>/>
Cr33per #24
Posted 08 August 2012 - 07:04 PM
But how do i get the code?
TCGM #25
Posted 08 August 2012 - 08:15 PM
But how do i get the code?

By opening the blatantly text file files included in the download zip folder. That can be opened with every text editor this side of Notepad.
basdxz #26
Posted 08 August 2012 - 10:20 PM
If I wanted to have this in my town on a tekkit server, how would I install it?
Cr33per #27
Posted 09 August 2012 - 04:05 PM
with paste bin but u need to ask the admin or owner to turn HTTP api on in configs
TCGM #28
Posted 09 August 2012 - 11:43 PM
If I wanted to have this in my town on a tekkit server, how would I install it?

Ask the administrator of the server to follow the installation instructions up to having it on a disk. Alternatively, to give access to these programs for all computers, you can have the admin copy the program files to the (server root folder here)/mods/ComputerCraft/lua/rom/programs folder.
basdxz #29
Posted 10 August 2012 - 01:25 AM
The server is a public one so I don't think he will do that, is there any way to get it done without having to write it all down like just do pastebin get (code id) disk/mail and just run disk/mail to install it?
thatsimplekid #30
Posted 16 December 2012 - 04:03 PM
Having a play.

Only reason for disk is if you remove the computer I guess?

The disk install instructions are for server admins who might want to mass-install this program on their server for a server-wide email system that works.

I'm also amazed that people are poking holes in my instructions. Seriously. I see quite a few programs in this subforum devoid of any instructions whatsoever. I can't know every possible install path! T_T

You assume we are morons.
You also assume we know exactly how to install a program we did not create
It's Not Hard
dunkee #31
Posted 17 December 2012 - 07:28 AM
The number of the disk isn't visible with just ComputerCraft installed. These instructions rely on a TMI/NEI-type inventory mod.
It is. You just have to navigate into the computercraft files after labeling the disk, then it shows you all the disk ids and labels.
gamed9x #32
Posted 25 December 2012 - 11:45 AM
Help, it says Table Text FIle could not be found!
TCGM #33
Posted 26 December 2012 - 10:54 AM
Help, it says Table Text FIle could not be found!
"It"

By "it" do you mean the server computer or the email client?
micb123 #34
Posted 28 December 2012 - 10:11 AM
when is the version with out the mailserv:42:expected string error coming out?
HotGirlEAN #35
Posted 28 December 2012 - 02:45 PM
I don't think this is the TRUE successor to CCEmail, as the emails don't appear to be stored ONLINE through PHP.
:)/> Also, colors would be lovely on this!
Cozzimoto #36
Posted 28 December 2012 - 03:41 PM
you can make it where you can auto detect where the modem is on the computer instead of restricting it to only the right side. if it hasnt been suggested yet
HotGirlEAN #37
Posted 28 December 2012 - 03:44 PM

for k, v in ipairs(rs.getSides()) do rednet.open(v) end
Grim Reaper #38
Posted 28 December 2012 - 04:01 PM

for k, v in ipairs(rs.getSides()) do rednet.open(v) end

This is unnecessary, although it does work.

If you wanted to be more specific and test to see if a modem is actually connected to your computer, you could use the following

function openModem()
   for sideIndex, side in ipairs(rs.getSides()) do
      if peripheral.getType(side) == "modem" then
         rednet.open(side)
         return
      end
   end

  error("No modem attached.")
end
HotGirlEAN #39
Posted 28 December 2012 - 04:03 PM
However doing it in my method actually saves you time and code. But you might pay for it later in your "Bug reports" section. xD
Grim Reaper #40
Posted 28 December 2012 - 04:37 PM
However doing it in my method actually saves you time and code. But you might pay for it later in your "Bug reports" section. xD

By 'time' do you mean execution time or just typing? In terms of execution time, I don't think the difference is anymore than a few nanoseconds, but I could be wrong.
HotGirlEAN #41
Posted 28 December 2012 - 04:38 PM
Just typing the code xD haha
DarkenedEvil #42
Posted 28 December 2012 - 05:15 PM
personally i would have a config option to allow the user to put in the modem side then save in in a table to be easily referenced to later. for example


print("Please enter modem side.")
write("> ")
local mside = read()
local fileopen = io.open("config", "w")
local info = {modemside = mside}
local dataS = textutils.serialize(info)
local writeIsFail = fileopen:write(dataS)
fileopen:close()

Then to read it all you have to do is

local info = io.open("config", "r")
local dataS = info:read()
local data = textutils.unserialize(dataS)
local modemside = data.modemside
HotGirlEAN #43
Posted 28 December 2012 - 05:18 PM
That'd be too much, :3 why trouble the user by asking?
DarkenedEvil #44
Posted 28 December 2012 - 05:25 PM
Thats just the way I would do it.
HotGirlEAN #45
Posted 28 December 2012 - 05:34 PM
Lol, I'd rather have it done automatically than have an input completely for setting up your modem.
TCGM #46
Posted 02 January 2013 - 04:10 AM
OOOH boy… Quite a lot of posts since I was last on this forum! Let me try and answer them all as best I can…


when is the version with out the mailserv:42:expected string error coming out?

The code on that line is if message == "readmail" and fs.exists(id) then . I see no request for a string; which tells me that either you copied the code wrong or I'm missing something.

I don't think this is the TRUE successor to CCEmail, as the emails don't appear to be stored ONLINE through PHP.
:)/> Also, colors would be lovely on this!

At the point when I created TCMail, CCEmail did not have anything except simple server-client code, and the author hadnt posted for a while as far as I could tell. He has apparently since updated it. I'll rename the topic if you feel it needs to be done.

you can make it where you can auto detect where the modem is on the computer instead of restricting it to only the right side. if it hasnt been suggested yet

Excellent suggestion sir! I have also read the following couple of posts, and am going to implement the method HotGirlEAN has mentioned. It is short and sweet, and I can't see any problems with it.


for k, v in ipairs(rs.getSides()) do rednet.open(v) end

Implementing in the next update.

personally i would have a config option to allow the user to put in the modem side then save in in a table to be easily referenced to later. for example


print("Please enter modem side.")
write("> ")
local mside = read()
local fileopen = io.open("config", "w")
local info = {modemside = mside}
local dataS = textutils.serialize(info)
local writeIsFail = fileopen:write(dataS)
fileopen:close()

Then to read it all you have to do is

local info = io.open("config", "r")
local dataS = info:read()
local data = textutils.unserialize(dataS)
local modemside = data.modemside

Using HotGirlEAN's method.

On a side note, it looks as if TCMail is going inside of KREOS, as kornichen has requested I give him permission (obviously I said yes).
I NO LONGER PLAY MINECRAFT #47
Posted 07 January 2013 - 08:50 AM
I'm new to this (so sorry if this is a noob question :wacko:/> ) but when i try to set the disk name it just sets the computer name to "disk TCMail" I ran label set disk TCMail…
I NO LONGER PLAY MINECRAFT #48
Posted 07 January 2013 - 09:00 AM
I'm new to this (so sorry if this is a noob question :wacko:/> ) but when i try to set the disk name it just sets the computer name to "disk TCMail" I ran label set disk TCMail…
don't worry just copied a null file into the disk to find it
I NO LONGER PLAY MINECRAFT #49
Posted 07 January 2013 - 09:14 AM
OK now i get Table Text File does not exist on the first server computer i tried creating a text file named Table in the disk folder and running directly off the disk but nothing (im proberbly being really dumb though :P/>)
FQuimson23 #50
Posted 19 January 2013 - 08:22 PM
OOOH boy… Quite a lot of posts since I was last on this forum! Let me try and answer them all as best I can…


when is the version with out the mailserv:42:expected string error coming out?

The code on that line is if message == "readmail" and fs.exists(id) then . I see no request for a string; which tells me that either you copied the code wrong or I'm missing something.

I don't think this is the TRUE successor to CCEmail, as the emails don't appear to be stored ONLINE through PHP.
:)/> Also, colors would be lovely on this!

At the point when I created TCMail, CCEmail did not have anything except simple server-client code, and the author hadnt posted for a while as far as I could tell. He has apparently since updated it. I'll rename the topic if you feel it needs to be done.

you can make it where you can auto detect where the modem is on the computer instead of restricting it to only the right side. if it hasnt been suggested yet

Excellent suggestion sir! I have also read the following couple of posts, and am going to implement the method HotGirlEAN has mentioned. It is short and sweet, and I can't see any problems with it.


for k, v in ipairs(rs.getSides()) do rednet.open(v) end

Implementing in the next update.

personally i would have a config option to allow the user to put in the modem side then save in in a table to be easily referenced to later. for example


print("Please enter modem side.")
write("> ")
local mside = read()
local fileopen = io.open("config", "w")
local info = {modemside = mside}
local dataS = textutils.serialize(info)
local writeIsFail = fileopen:write(dataS)
fileopen:close()

Then to read it all you have to do is

local info = io.open("config", "r")
local dataS = info:read()
local data = textutils.unserialize(dataS)
local modemside = data.modemside

Using HotGirlEAN's method.

On a side note, it looks as if TCMail is going inside of KREOS, as kornichen has requested I give him permission (obviously I said yes).
Well I'm no expert here but I can fix the 42 string error. Just add Quotation Marks at (id) so it looks like ("id"). I'm sure this will help :D/>
pauliuskas05 #51
Posted 25 November 2013 - 02:00 PM
Hi, I have got problem. I can't send email.
Derpford #52
Posted 27 November 2013 - 07:58 AM
I've figured out what causes the expected-string error.
You see, your mailserv code waits for a rednet message and stores the id of the sender along with the message itself, and then uses the id of the sender as the name of the folder to store the message in, which is a good way of handling messages.

However, the id of the sender is sent as a number, and folder names are stored as strings. Numbers and strings are not interchangeable; you have to convert a number to a string before it can be used as a string.
Derpford #53
Posted 27 November 2013 - 08:45 AM
I have put together an improved version of the mailserv program.
It's got exactly one edit: I added a line at the beginning of the loop that handles messages.

It went from this:
id, message = rednet.receive()

To this:
id, message = rednet.receive()
id = tostring(id)
No more string expected error.