3 posts
Posted 16 December 2013 - 08:30 AM
So, I have
this code already (I am trying to make my own chat program) but for some reason, the rednet.send() on line 26 won't work, because it requires a number. I thought I could do this by using tonumber(), but it doesn't work.
I would be very pleased if you could tell me how I can do this.
Thanks in advance
Datdenkikniet (Jona)
41 posts
Posted 16 December 2013 - 11:15 AM
To use rednet.send, you need to provide two arguments, the channel and the message. All computers listening to that channel can receive the message. Here's an example:
id = 29
msg = "Hello, Computer #"..id
rednet.send(id, msg)
Edited on 16 December 2013 - 01:22 PM
621 posts
Location
U.S.A.
Posted 16 December 2013 - 01:17 PM
To use rednet.send, you need to provide two arguments, the channel and the message. All computers listening to that channel can receive the message. Here's an example:
id = 29
msg = "Hello, Computer #29"
rednet.send(29, msg)
I believe you mean
rednet.send(id, msg)
41 posts
Posted 16 December 2013 - 02:22 PM
To use rednet.send, you need to provide two arguments, the channel and the message. All computers listening to that channel can receive the message. Here's an example:
id = 29
msg = "Hello, Computer #29"
rednet.send(29, msg)
I believe you mean
rednet.send(id, msg)
I'll edit the post
3 posts
Posted 16 December 2013 - 02:24 PM
Yes, but the string from the arguments used in chat <ID> where <ID> is the argument, should be converted in to an int, but it wont!
8543 posts
Posted 16 December 2013 - 02:45 PM
Lua is one-indexed, not zero-indexed. Change line 26 to use both tonumber and the correct indexing:
rednet.send(tonumber(chatID[1]), "authentication!!!!")
3 posts
Posted 16 December 2013 - 03:26 PM
Lua is one-indexed, not zero-indexed. Change line 26 to use both tonumber and the correct indexing:
rednet.send(tonumber(chatID[1]), "authentication!!!!")
Aha, thank you very very much Lyqyd