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

Rednet connection system.

Started by wilcomega, 26 April 2014 - 10:58 AM
wilcomega #1
Posted 26 April 2014 - 12:58 PM
this is basicly the sonnection system that is used in the chat system but built into rednet so you can use the api for it.
in my eyes the would look something like so:

local status, con = rednet.connect("wilcosgamehost") -- takes first argument as a string for hosts, and number for non-hosts
if status == 1 then -- diffrent status codes, like in http
  -- succesfull, lets request the game data
  con.send({"gameinfo"})
  local msg = con.receive()
  if msg[1] == "bomberman" then con.disconnect() end -- just an example
end

as you can see when you conenct a status code and a connection object is returned that can be used to send and receive messages. also the connection object also pings automaticly so when you lose connection the object will tell you its because of a time out. maybe you could check it like

if con.error == rednet.timeout then print "timed out, check your rednet connection" end

why this should be implemented:
this allows for a more controlled and regulated system. it also allows for a more easy communication and connection check.
of course all of you always looking to turn down suggestions will say, "but this is already possible with current rednet features". yeah i know, but dan did implement all of these rednet features, liek hosting and chat, and i am fairly certain that he knew that it was already possible without these new built-in features. this absolutly does not take weeks to code liek PDA's its a nice little feature that will improve rednet overall and make it a bit more regulated and realistic too.

well, i hope you all comment and do the poll, be sure to let me know what you think
Edited on 26 April 2014 - 10:59 AM
Saldor010 #2
Posted 26 April 2014 - 05:53 PM
You said it yourself, it's already possible. Would you rather have core features that we can't program ourselves? Or stupid API's we can already code ourselves with 30 minutes of (maybe not even) hard work. I'm looking at you window API :angry:/>
wilcomega #3
Posted 26 April 2014 - 06:08 PM
You said it yourself, it's already possible. Would you rather have core features that we can't program ourselves? Or stupid API's we can already code ourselves with 30 minutes of (maybe not even) hard work. I'm looking at you window API :angry:/>
what you are saying is true, but before the rednet update with the repeat program, everyone had their own and they just didnt work together,
this system allows for easy communication and monitoring the connection and stability. i think its worth implementing,

ps, if you are JUST going to look at the side where all the bad stuff is, then maybe you should only look at the bright side, where rainbows are, rednet works alot better and everyone is happy. i am pretty sick of people only turnng down suggestions because they cant see the potential. i just wanted to throw that out there

i love the window api as it is a built in way, a "correct" way of doing it as perviously diffrent programs made by diffrent people all had diffrent formats and it just didnt work. now that we have 1 universal thing that is built in, it can be used by every program and every program will be compatible instead of having to make alot of handlers for all of the diffrent programs.

my point is that when dan makes something its most likely 200% more stable and since he puts it in CC it will be used by all of the community. alot more stable, no compatebility issues. just better in general
Edited on 26 April 2014 - 04:11 PM
Saldor010 #4
Posted 26 April 2014 - 07:16 PM
You said it yourself, it's already possible. Would you rather have core features that we can't program ourselves? Or stupid API's we can already code ourselves with 30 minutes of (maybe not even) hard work. I'm looking at you window API :angry:/>
what you are saying is true, but before the rednet update with the repeat program, everyone had their own and they just didnt work together,
this system allows for easy communication and monitoring the connection and stability. i think its worth implementing,

ps, if you are JUST going to look at the side where all the bad stuff is, then maybe you should only look at the bright side, where rainbows are, rednet works alot better and everyone is happy. i am pretty sick of people only turnng down suggestions because they cant see the potential. i just wanted to throw that out there

i love the window api as it is a built in way, a "correct" way of doing it as perviously diffrent programs made by diffrent people all had diffrent formats and it just didnt work. now that we have 1 universal thing that is built in, it can be used by every program and every program will be compatible instead of having to make alot of handlers for all of the diffrent programs.

my point is that when dan makes something its most likely 200% more stable and since he puts it in CC it will be used by all of the community. alot more stable, no compatebility issues. just better in general

What do you mean every program will be "compatible"? No matter what API someone uses, it will be rendered the same way. Weren't the window API's before already compatible? Also, if everyone looked on the bright side all the time, the world would be much more twisted. "Lets kill all of the French! On the bright side, we won't have to deal with their stupid accents! Hey, lets burn down the White House! On the bright side, we won't be discriminating against the blacks anymore!" (No offense meant, this is just an example.)
Edited on 26 April 2014 - 05:16 PM
wilcomega #5
Posted 26 April 2014 - 07:35 PM
i mean like when 2 programs use screen capture, and one is used to receive and the other to send but they have diffrent formats :(/>
and also you are taking me to literaly. i mean like some people can only see the bad things in suggestions and of course there are bad suggestions but this is just nice to have and from what i can tell it does not have a down side, oh and this is also called common sense, of course you dont kill all the french people or burn down the white hous,e those are stupid suggestions and bad examples. common sense

this is not going anywhere, lets just stay on-topic from now on
Edited on 26 April 2014 - 05:35 PM
viluon #6
Posted 26 April 2014 - 08:21 PM
+1 Jiloacom (on-topic enough?)

It wouldn't be fun THAT simple. I find it better to code an API myself and share it with the community rather than to come to a completed work (if u know what I mean)
Edited on 26 April 2014 - 06:24 PM
Saldor010 #7
Posted 26 April 2014 - 09:45 PM
+1 Jiloacom (on-topic enough?)

It wouldn't be fun THAT simple. I find it better to code an API myself and share it with the community rather than to come to a completed work (if u know what I mean)

Yeah, same here. It isn't fun if your entire chat program is just 10 lines (not including your user interface). Plus, you don't get that satisfaction of knowing you completed something when it takes a grand total of 7 minutes to code.

i mean like when 2 programs use screen capture, and one is used to receive and the other to send but they have diffrent formats :(/> …

When would 2 screen capture programs ever have to send and receive to each other? If 1 of the programs is the server and 1 of the programs is the sender, I could see that, but even then they would essentially be the same program written by the same programmer. So why would they have different formats? Maybe you should have a better example.
wilcomega #8
Posted 26 April 2014 - 10:09 PM
i fully understand the statisfaction that you get from making something big. but when you let the community make diffrent versions of the same thing, like the connection api, it will be like a shithole of people that dont speak the smae language. and i just want that eliminated. (period)
Saldor010 #9
Posted 26 April 2014 - 11:11 PM
i fully understand the statisfaction that you get from making something big. but when you let the community make diffrent versions of the same thing, like the connection api, it will be like a -snipped language- of people that dont speak the smae language. and i just want that eliminated. (period)

Well, to be honest, it isn't that big of a deal. Most programs will never need to communicate to another program in their lifetime, and even if they did, the programmer should have been smart enough to adapt the program to other formats. (Also, you are assuming that everyone is going to switch over to the connection API. What if some people don't?)
Edited on 26 April 2014 - 09:16 PM