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

[Help]Email client (mod please lock forum)

Started by AnDwHaT5, 22 February 2013 - 10:58 AM
AnDwHaT5 #1
Posted 22 February 2013 - 11:58 AM
I want to make a email client but I'm not sure my idea will work. I want to make a Input go into a program with print in it already so when you open the file it prints the email. I plan after making it into a file to send the file to a server which loads the file if the other computer is off. This is using API. If computer is turned on I want the email that was logged on the server to send to the other computer when the receive command is activated. After the email is received it goes into the computers API and then go into the dictionary called emails. If the computer was on when sent then it goes strait to the computer and loads into API. I have a idea how to do this but I need help making a code for all of this. Mainly the part where a input goes into a file with print in it so when activated it shows up as the email. Please. Help
Sammich Lord #2
Posted 22 February 2013 - 12:06 PM
What did I just read?
AnDwHaT5 #3
Posted 22 February 2013 - 12:14 PM
A huge idea for a email client that i cant make until i can put a input into a program with pre written code for the email format. The other way it can be done is if you simply edit the email format it self by using copy on a program that has the format on it and all you do is edit it in the edit mode but that's not nearly as efficient
AnDwHaT5 #4
Posted 23 February 2013 - 12:36 AM
Is anyone able to help me on this?
theoriginalbit #5
Posted 23 February 2013 - 01:02 AM
Well considering I've read OP and your comment about 20 times over and still cant understand what you're trying to say … I'm going to have to say, I can't help you …
Mads #6
Posted 23 February 2013 - 01:02 AM
If you are not even able to code a basic programme, don't try to code an email client.
AnDwHaT5 #7
Posted 23 February 2013 - 01:09 AM
NO, i can code a basic program, in fact my new OS is almost done. All i need to know is how to make a input into a basic program that will make it work as a email.
Mads #8
Posted 23 February 2013 - 02:42 AM
If you don't know how to get user input, you don't know how to make an OS. Simple as that.
remiX #9
Posted 23 February 2013 - 02:51 AM
NO, i can code a basic program, in fact my new OS is almost done. All i need to know is how to make a input into a basic program that will make it work as a email.

Give us snippets of the os then :]

And re-explain what you tried to explain in the OP, because no one seems to understand what you're trying to say
theoriginalbit #10
Posted 23 February 2013 - 03:02 AM
because no one seems to understand what you're trying to say
I think I'm understanding a little. I think he wants a program that the user can type something, and … it sends as an email.
remiX #11
Posted 23 February 2013 - 03:24 AM
because no one seems to understand what you're trying to say
I think I'm understanding a little. I think he wants a program that the user can type something, and … it sends as an email.

Oh, then that's easy - you will have a php webpage - like this - which you use http.post to send the relevant information, emailing the address associated within the php code
Bubba #12
Posted 23 February 2013 - 03:41 AM
I'm pretty sure he wants an email client that is ComputerCraft specific (not web enabled), much like Nitro did in one of his first videos.
Mads #13
Posted 23 February 2013 - 04:13 AM
Noone is gonna write a program for you, so this is what I think you whould do:

1. Learn Lua
2. Write it yourself
3. ???
4. PROFIT???
theoriginalbit #14
Posted 23 February 2013 - 04:15 AM
#3. Repeat until understanding > "good" :P/>
LBPHacker #15
Posted 23 February 2013 - 07:19 AM
You know, this forum (I mean Ask a Pro) is not about helping people who don't want to type 16749 characters only to send an email to a computer in Minecraft, but about helping people who got stuck with their code.

I don't want to hit your feels, but we are not coding monkeys.



BTW, Hey guys, I don't really speak English either, but am I as illegible as him?
ChunLing #16
Posted 23 February 2013 - 09:22 AM
You're fine, in the class of making me think "maybe I too can get away with claiming not to speak English".

I'm going to try to translate this, wish me luck.
I want to make a email client but I'm not sure my idea will work.[clear enough] I want to make a Input go into a program with print in it already so when you open the file it prints the email.[the email program does not have to be running when the email is sent, but can download and display it when it is run] I plan after making it into a file to send the file to a server which loads the file if the other computer is off.[there will be a server which will receive and store all incoming emails, sending them to the destination only when the email checking program is run] This is using API.[undetermined if this is an existing API or one yet to be written, also indeterminate what the API will do] If computer is turned on I want the email that was logged on the server to send to the other computer when the receive command is activated.[describes already translated intention of program operation] After the email is received it goes into the computers API and then go into the dictionary called emails.[this could be saying that the API will revolve around automated file-keeping of the received emails, though it isn't clear why this needs to be part of the API rather than just part of the email program] If the computer was on when sent then it goes strait to the computer and loads into API.[The program has a mode that constantly checks for new email on the server] I have a idea how to do this but I need help making a code for all of this.[unclear whether this is an expectation of code monkeys or simply an admission that the program will need help] Mainly the part where a input goes into a file with print in it so when activated it shows up as the email.[apparently the initial idea of how to do this is conceptually flawed] Please. Help
Okay, I'm going to suggest that there is a server program and an email client program. They both use an API dedicated to efficiently storing emails. The client program is used to send a message to the server, where it will be parsed as a file (or in a file) to be sent to the recipient once that client logs in. When the client is logged in, it will ping the server upon starting and periodically to check for messages. When pinged, the server will check the file (or files) associated with that client and reply with the content of those files. I suppose that it may then delete the files (or rename them) so that they don't get resent every time (if the files still exist, perhaps there could be a way for the client to retrieve old messages in the event that they were lost in transmission or deleted locally). The client both saves and displays (and allows the user to browse) the received messages.
AnDwHaT5 #17
Posted 23 February 2013 - 09:23 AM
Dude all of you got it wrong i want a input to go into a program that simple. Your pulling crap out of your *** for nothing. I want the input to go into a program I know I/o I'm coding it my self. I'm starting it tonight all I'm is stuck on this one part of my code. If you guys continue to be complete ***** I will ask staff to lock the forum.
AnDwHaT5 #18
Posted 23 February 2013 - 09:25 AM
Chunling you are currently the closest to what I mean.
ChunLing #19
Posted 23 February 2013 - 09:47 AM
Okay, you have two programs to write, the client and the server.

The server runs continuously (and restarts automatically if there's a chunk reload), waiting for messages. When it gets one, you have to use some string functions to determine the intended recipient, then save the messages into a file (fs.open(), using a filename based on the recipient and append mode seems appropriate). It might also automatically include the ID of the sender (if the client doesn't handle that). When it gets a ping from a client, it checks for whether there is anything in the file associated with that client, and if there is it sends the contents of the file and then resets/deletes the file (possibly appending them to a log file if that's desired).

The client program does three things. When it first runs (and at reasonable intervals while running), it pings the server and gets any messages, both saving and displaying them (you'll probably want a scrollable display). It also allows the user to compose and send messages (probably giving some formatting help so that the server doesn't have trouble figuring out the recipient). Okay, depending on how we're counting, that could be more or less than three tasks…I was thinking of getting the messages as a separate task from saving/displaying them, though really saving and displaying them would be legitimately different tasks from each other too. But composing and sending the message seems like a single task to me.

Anyway, all of those are doable. Let us know when you run into any problems coding it.
Sammich Lord #20
Posted 23 February 2013 - 09:53 AM
Chunling you are currently the closest to what I mean.
Are you thinking this is a game? Did you intentionally make this post to see how hard we would try to help you?
ChunLing #21
Posted 23 February 2013 - 10:00 AM
I'm guessing not. The conceptual problem seems to have been either how to make the server aware that a client was "logged on" or how to use the fs API.

English is hard. I almost gave up on learning it at first (and that's when the alternative was banging my head on things and screaming…which worked pretty good until my mom figured out I was doing it as a way to avoid having to learn English).
AnDwHaT5 #22
Posted 23 February 2013 - 10:02 AM
Thanks chunling.
AnDwHaT5 #23
Posted 23 February 2013 - 10:13 AM
btw the server dosnt sense when it gets on you use a command that is sent to it say "checkmail" which will update it. Upon send it will use if message == "checkmail" then i haven't tested the theory yet but i think it will work.
theoriginalbit #24
Posted 23 February 2013 - 01:45 PM
Chunling you are currently the closest to what I mean.
Are you thinking this is a game? Did you intentionally make this post to see how hard we would try to help you?
I seems like it.

English is hard.
Indeed it is, its my first and only language and sometimes I hate it, with all its same words different meanings, etc.

btw the server dosnt sense when it gets on you use a command that is sent to it say "checkmail" which will update it. Upon send it will use if message == "checkmail" then i haven't tested the theory yet but i think it will work.
So more of a POP service then.
Lyqyd #25
Posted 23 February 2013 - 04:13 PM
I see no particular reason to lock this. However, if you're here to poke at the question asker rather than help, you can kindly go elsewhere. An OP being obstinately ignorant is one thing, but someone who is actually seeking help and doesn't know how to phrase the problem is quite another. I'm not sure which case this is.
ChunLing #26
Posted 23 February 2013 - 05:41 PM
There's the case where communication barriers cause the latter to decay into the former.

Anyway, having the server respond to a "check mail" ping is indeed the safest way. Otherwise you have the problem of a client terminating (or being chunk unloaded) without having a chance to notify the server that it's no longer available, which would lead to lost messages. And it's easier to have the client listen for messages immediately following a "check mail" ping than it is to have it passively receive them while doing something else (like composing/browsing other messages).