ID:161121
 
Although i'm quite an expert on coding, barring the odd mental block here and there, I've never tried to go past a certain point in BYOND. Well anyway, I was wondering, is it possible to have things submitted to me in my game, like bug reports or highscores? I mean, not just whispered to me while i'm online; they the submission will be saved somewhere and given to me somehow at an appropriate time. That would be great.
You could create a text file. Make a string variable, add the bug reports or whatever to it, then use text2file() or something and ftp() to save it.
In response to Kaiochao
Sure, I could save it, but where could I save it to so that I could get it? And preferably, so that I could know that it's there, too. Thanks.
In response to Adam753
You could probably use the browser to e-mail yourself.
In response to Adam753
You could save it to the host's computer, then I think download it from there also. I'm not sure about it, since I haven't done any "remote server managing" things.
In response to Giantpandaman
I didn't know the browser could do that! Cool, i'll look into it.
3 people posted at once! I'm sure one of the two useful posts was a good answer! Well, if the prowser can email people, i'm sure that will work perfectly. But, I think saving it to a file on one computer won't work, because it would need both me and that person to be online. But you said save it to the host's computer, which means both me and the host would have to be online. Or all three of us? I've confused myself! I'm gonna come back tomorrow.
I wrote a utility that'll handle all of this for you:

http://www.byond.com/hub/UnknownPerson/upCommentBox
In response to Adam753
Adam753 wrote:
I didn't know the browser could do that! Cool, i'll look into it.

It can't. You see, it's a browser, not an e-mail client (neither is the BYOND browser more special than your common Internet Explorer window). However, you could ultimately send an e-mail through it, using some javascript and a ready server or other system for doing the actual sending part. But for that matter, you could use an external program to do that with shell() or through an external function in a DLL.

But, I think saving it to a file on one computer won't work, because it would need both me and that person to be online. But you said save it to the host's computer, which means both me and the host would have to be online. Or all three of us? I've confused myself!

Indeed you have... the only place you have access to be able to save a file to is the game server/host, which is the computer the game is running on, anyway*. BYOND wouldn't be very secure if every anime "c0d3r" had the ability to freely place and execute files on every player's computer, now.
Of course it would require you being present in order for you to look at the file, unless you're telepathic or something... what was that about? If you mean it would require you being present in order to save a file on the server computer, there's no reason why it would.

So, in short, if you are an "expert coder" (right...), you have some experience with DM already. I take it you've messed with saving players mobs in a savefile. Guess what, this is no different. Instead of saving mobs, you'd be saving the messages. Simple enough, isn't it?

*: The exception would be a client-side savefile.
In response to Unknown Person
You came along at EXACTLY the right time, as if waiting for your cue. Well, that's exactly what I asked for, but now I have another question (Bearing in mind that i'm tired right now): could I make the comment contain a file, or something? [Probably using file2text()?] The sender could browse their files for a saved file or something- that way the files COULD be saved to computers and sent later! Brilliant. Now, i'm going to sleep, GOODBYE.
In response to Adam753
Adam753 wrote:
could I make the comment contain a file, or something? [Probably using file2text()?] The sender could browse their files for a saved file or something- that way the files COULD be saved to computers and sent later!

That is quite possible. If you're up to it, you're free to modify the utility for your own personal use, though it seems like a good idea for me to natively support in some future version if I have time to update the utility. The trick would be to use input(), then store the uploaded files in a list defined in the /upComment datum. It would be a good idea to consider limiting file sizes (which length() does fine, although BYOND will have to wait for the file to upload before that happens). For the manager to download the files, ftp() could be used. And yes, as you mentioned, if you want the comment to display the contents of the file (given that it's a readable text file), then you would use file2text().
In response to Kaioken
When I posted that I didn't mean directly e-mail yourself, but wouldn't it be possible to send the info to a separate server using <form>, and store it there. There are also some online contact form scripts, that you might be able to use in the browser.
In response to Giantpandaman
You could just off load the information a php/mysql webhost store it in mysql.

Either way i think that niffty upCommentBox is just great :P
In response to Unknown Person
Of course... Actually, the reason I said that was because I don't know how your upComment works. For one thing, me and JS are less compatible than sausages and custard; also remember that i've NEVER explored this element of BYOND before. So, if you don't mind telling me... how would I do that?
In response to A.T.H.K
database storing would be nice and clean (and reasonably tamper-proof, as in the host can't really muck with it).

one feature to have would be an special 'bug-report-view' verb that displays the contents of the file (or database) to those with access to those commands. You could even expand on that idea by being able to delete 'fixed bugs' and resave the file.

As you are an 'expert coder', it should be easy to figure these out with a little experimentation! :)