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

Sending a message to a computer but with a twist

Started by Voidfusion, 26 July 2012 - 06:28 AM
Voidfusion #1
Posted 26 July 2012 - 08:28 AM
Okay, so I play on a server where ComputerCraft is used quite frequently. So, I came up with an idea to make it to where everyone could communicate with each other through computers, but not in the sense you would normally think of.

What I was thinking was, make a program that would ask what you want to send, and then ask to what computer ID you want to send it to.

So for it to read the message and the ID, then put it in to a rednet.send function, I know I would have to use variables, but how would it be set-up?
KingMachine #2
Posted 26 July 2012 - 08:30 AM
If you studied a minute amount of lua (or coding in general) you would quickly find the answer. Otherwise you're better off using someone else's program because without guts there is not glory.
Voidfusion #3
Posted 26 July 2012 - 08:39 AM
If you studied a minute amount of lua (or coding in general) you would quickly find the answer. Otherwise you're better off using someone else's program because without guts there is not glory.

Well then, what's the point of posting if you aren't going to post anything useful?

This is a section for Asking the Pros, and I don't see a 'Pro' tag anywhere near your name.
KingMachine #4
Posted 26 July 2012 - 08:49 AM
I just posted the most useful thing you could possibly read but your ignorance and inability to support logic and wisdom is not an excuse claim my post "not useful". Thanks for trying.
It really isn't my fault that you don't know how to code and we're NOT going to do it for you.
NO GUTS NO GLORY
Voidfusion #5
Posted 26 July 2012 - 09:06 AM
I just posted the most useful thing you could possibly read but your ignorance and inability to support logic and wisdom is not an excuse claim my post "not useful". Thanks for trying.
It really isn't my fault that you don't know how to code and we're NOT going to do it for you.
NO GUTS NO GLORY

I admit, reading up on lua should have probably been the first thing I should have done. But I came here to get help on the topic at hand. My usage of 'useful' meant posting something about the question I asked, instead you posted something that would most likely end up wasting both of our time, which we are doing at this very instant. Because of your foolish choice to waste both of our time, I'll make it worth-while.

Second, I truly did not know that you represented the entire community of ComputerCraft, if you do, congrats to you, but if you don't please don't speak for them, as some of them might not want you to.

Third. My statement of 'You are not a pro', is still standing, so if you are a Pro, which you are in fact not, please withdraw yourself from this thread and don't return with any snotty remarks.

Fourth. From my understanding of what I've seen, you seem to repeat useless phrases to the topic at hand, as it may be, that phrase seems to be 'No guts no glory', which is not useful at all, since it isn't about ComputerCraft. I understand it might be something to live by, But it has no point in being in this thread at this time.

Now, if anyone wants to actually help by providing useful information to the thread at hand, I would be oh-so-grateful.
limdingwen #6
Posted 26 July 2012 - 09:37 AM
I'm not a pro but I could be of some help. :)/>/>

If you just want to use off an existing program you can use The Internet Pack.

If you want to make your own, you can make a router program that searches for every other router it is connected to, then searches for the computer id in the other routers (or itself), then when the local program sends a message to the router which activates the above stated procedure.
KingMachine #7
Posted 26 July 2012 - 09:39 AM
You can't social engineer me into doing it for you.
No guts, no glory. No one is going to do it for you. Even if they did, you're better off just using someone else's program and SAVING YOUR TIME because if you can't even flowchart it, you're utterly desperate.
Your opinion on my level of skill is completely invalid considering it clearly states that "anyone may post" in this section.
I AM speaking for the entire computercraft community who will agree with me that us wasting our time on you saving time is COMPLETELY basackwards. ESPECIALLY when you've ADMITTED to needing to look at how to do lua first. Based on the way you've worded it, you don't even know anything about lua.
Simply stating that I'm not a pro doesn't make what I've said an less valid. You just WILL NOT LISTEN to me. That will be your undoing, because coding is an arcane knowledge that you will not possess without an open mind.
I pity you and your dim future and pray that enlightenment will come before your end.
pfft…Snotty remarks..if only you knew that I was trying to help you think smarter and more independently. But alas, even my stating that will not inform you.
I will withdraw from nothing because I believe in what I've said completely to the end of my life.
This isn't about coding. This is about standing up and doing things for yourself.
I'll even say it backwards.
glory no? guts no
1lann #8
Posted 26 July 2012 - 10:05 AM
Okay, so I play on a server where ComputerCraft is used quite frequently. So, I came up with an idea to make it to where everyone could communicate with each other through computers, but not in the sense you would normally think of.

What I was thinking was, make a program that would ask what you want to send, and then ask to what computer ID you want to send it to.

So for it to read the message and the ID, then put it in to a rednet.send function, I know I would have to use variables, but how would it be set-up?
Here's how to use rednet.send http://computercraft.info/wiki/index.php?title=Rednet.send
The way you would set it up is by using asking the user for the ID and message by using print and read
So it'll look like this

print("Enter computer ID")
id = read()
print("Enter your message")
msg = read()
Now since the ID has to be a number, you'll have to use tonumber() for reading the computer ID so it'll be like

print("Enter computer ID")
id = tonumber(read()) -- We add the tonumber function here
print("Enter your message")
msg = read()
Then you just send it off using rednet.send()

rednet.send(id, msg)
Also don't forget to do rednet.open(side) to open the modem at the start of the program.
That's pretty much it!
djblocksaway #9
Posted 26 July 2012 - 10:09 AM
You can't social engineer me into doing it for you.
No guts, no glory. No one is going to do it for you. Even if they did, you're better off just using someone else's program and SAVING YOUR TIME because if you can't even flowchart it, you're utterly desperate.
Your opinion on my level of skill is completely invalid considering it clearly states that "anyone may post" in this section.
I AM speaking for the entire computercraft community who will agree with me that us wasting our time on you saving time is COMPLETELY basackwards. ESPECIALLY when you've ADMITTED to needing to look at how to do lua first. Based on the way you've worded it, you don't even know anything about lua.
Simply stating that I'm not a pro doesn't make what I've said an less valid. You just WILL NOT LISTEN to me. That will be your undoing, because coding is an arcane knowledge that you will not possess without an open mind.
I pity you and your dim future and pray that enlightenment will come before your end.
pfft…Snotty remarks..if only you knew that I was trying to help you think smarter and more independently. But alas, even my stating that will not inform you.
I will withdraw from nothing because I believe in what I've said completely to the end of my life.
This isn't about coding. This is about standing up and doing things for yourself.
I'll even say it backwards.
glory no? guts no
you dont need to act so offensive. not everyone is good at LUA and some people are new to computercraft. the fourms was made for new people to learn and see examples!
Luanub #10
Posted 26 July 2012 - 10:36 AM
You can't social engineer me into doing it for you.
No guts, no glory. No one is going to do it for you. Even if they did, you're better off just using someone else's program and SAVING YOUR TIME because if you can't even flowchart it, you're utterly desperate.
Your opinion on my level of skill is completely invalid considering it clearly states that "anyone may post" in this section.
I AM speaking for the entire computercraft community who will agree with me that us wasting our time on you saving time is COMPLETELY basackwards. ESPECIALLY when you've ADMITTED to needing to look at how to do lua first. Based on the way you've worded it, you don't even know anything about lua.
Simply stating that I'm not a pro doesn't make what I've said an less valid. You just WILL NOT LISTEN to me. That will be your undoing, because coding is an arcane knowledge that you will not possess without an open mind.
I pity you and your dim future and pray that enlightenment will come before your end.
pfft…Snotty remarks..if only you knew that I was trying to help you think smarter and more independently. But alas, even my stating that will not inform you.
I will withdraw from nothing because I believe in what I've said completely to the end of my life.
This isn't about coding. This is about standing up and doing things for yourself.
I'll even say it backwards.
glory no? guts no

Part of the vision of the CC Mod was to encourage people to learn programing. A lot of the people on the forums here are beginner or hobby programmers, not experts. Thus the ask-a-pro section :)/>/>

This community is great because of the helpful people that are on the forums and the help that they give to the beginners to help get them started. Don't ruin it with this type of crap.
KingMachine #11
Posted 26 July 2012 - 01:55 PM
Like I said before, it has nothing to do with code.
Lyqyd #12
Posted 26 July 2012 - 03:15 PM
OP: use a couple of read() calls to get the player input, tonumber() the id variable, then use the two inputs in the rednet.send().
Voidfusion #13
Posted 26 July 2012 - 04:37 PM
First off, I would like to thank the people that have been helpful, it really means a lot.

Second, mainly for KingMachine, I have been reading up on Lua, because it will be beneficial in the end. Still, you obviously weren't speaking for the entire CC community there, bud. :)/>/> Also, I'm a coder myself, I just didn't have the time right then and there to go read up. I know plenty of C#, C, and a little bit of Java. Although the last two I haven't actually worked with for about a year now. Hopefully, this should end the argument between us, don't you agree?
Voidfusion #14
Posted 26 July 2012 - 04:38 PM
Okay, so I play on a server where ComputerCraft is used quite frequently. So, I came up with an idea to make it to where everyone could communicate with each other through computers, but not in the sense you would normally think of.

What I was thinking was, make a program that would ask what you want to send, and then ask to what computer ID you want to send it to.

So for it to read the message and the ID, then put it in to a rednet.send function, I know I would have to use variables, but how would it be set-up?
Here's how to use rednet.send http://computercraft...tle=Rednet.send
The way you would set it up is by using asking the user for the ID and message by using print and read
So it'll look like this

print("Enter computer ID")
id = read()
print("Enter your message")
msg = read()
Now since the ID has to be a number, you'll have to use tonumber() for reading the computer ID so it'll be like

print("Enter computer ID")
id = tonumber(read()) -- We add the tonumber function here
print("Enter your message")
msg = read()
Then you just send it off using rednet.send()

rednet.send(id, msg)
Also don't forget to do rednet.open(side) to open the modem at the start of the program.
That's pretty much it!

Sorry for the double post, but this helped me alot, thank you.
Voidfusion #15
Posted 26 July 2012 - 07:47 PM
Okay, so I play on a server where ComputerCraft is used quite frequently. So, I came up with an idea to make it to where everyone could communicate with each other through computers, but not in the sense you would normally think of.

What I was thinking was, make a program that would ask what you want to send, and then ask to what computer ID you want to send it to.

So for it to read the message and the ID, then put it in to a rednet.send function, I know I would have to use variables, but how would it be set-up?
Here's how to use rednet.send http://computercraft...tle=Rednet.send
The way you would set it up is by using asking the user for the ID and message by using print and read
So it'll look like this

print("Enter computer ID")
id = read()
print("Enter your message")
msg = read()
Now since the ID has to be a number, you'll have to use tonumber() for reading the computer ID so it'll be like

print("Enter computer ID")
id = tonumber(read()) -- We add the tonumber function here
print("Enter your message")
msg = read()
Then you just send it off using rednet.send()

rednet.send(id, msg)
Also don't forget to do rednet.open(side) to open the modem at the start of the program.
That's pretty much it!

Alright so, I have it all set up, except one thing. My friend isn't getting the message I send to his Receiver computer's ID. Does the rednet.send function have a range limit?
Cranium #16
Posted 26 July 2012 - 08:45 PM
Check the WIKI. It tells you the range.
KingMachine #17
Posted 27 July 2012 - 05:25 AM
The receiving computer needs to call receive(timeout) (blank for infinite)
default range is 64. 16 in storms.