Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
mzx987

Internet Card: Logging data

Question

Alright, so I've been working on a small project on Opencomputers and I want to know some things related to the Internet Card.

 

I have a computer that I want to run as a Vending Machine. I pretty much have everything planned out, except for the Internet Card (I've practically never used it before). I want this Internet Card to send data to a simple server to log events certain events that happen.

 

I probably might not get good help for this, but I must ask: How would I pull this off? (The server-side portion and basic code for the Internet Card part).

Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Perhaps don't try to do this over the internet? Seriously - it would be much easier to connect your vending machine to a second computer via an (in-game) network cable, or if necessary a wireless network or two Linked Cards. If you were to send the data over the internet you'd need to worry about having a real server running on some computer and have it accessible over the internet. You'd also need to find some other language to write the server in. Lua is meant to be an embedded language used to script other applications, and although you can run Lua standalone I don't think there are any real libraries that you could use to run a server. If you already had a running server I would understand why you'd want to do this, but from what I can tell from your post it sounds like an unnecessary extra step to go over the internet.

Link to post
Share on other sites
  • 0

Well, that's just it. I want the extra challege. I want to go beyond the limitations. I can do all of this; I just need some time to do so. And I understand that I can't really do this as easily as I thought I could, but it would just seem amazing if I could pull it off.

 

But you are right. I am better off restricting this to sending data to another in-game computer.

Link to post
Share on other sites
  • 0

It's certainly not impossible to do this, though it is definitely a lot easier to keep everything in-game. It might be easier to first implement everything in OC Lua, and once you have that working try to port the server to a stand-alone language. I have never tried to write a server from scratch myself, so I can't help you with any specifics there.

 

If you're looking for a language to write the server in, you should give Python a try. It is a scripting lanugage like Lua and you'll quickly see certain similarities between the two, though they are very different in many aspects. In general Python is less simplified in certain aspects (e. g. foo.bar is not the same as foo["bar"]), but that doesn't make it harder to understand, once you know the differences you'll know their uses as well. Unlike Lua, Python also comes with an extensive collection of modules included in the base installation. This means that you may even be able to write your server without the need for any external libraries.

Link to post
Share on other sites
  • 0

Hmm... Sounds like a good idea to use Python for the server-side of things. Good think I have a bit of experience in that as well.

For now, I should definitely just restrict it to in-game only. I may have to dwelve into coding a server later on. Thanks for your help!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.