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)
Numbers...
Started by datdenkikniet, Dec 16 2013 08:30 AM
6 replies to this topic
#1
Posted 16 December 2013 - 08:30 AM
#2
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 by Ajt86, 16 December 2013 - 02:22 PM.
#3
Posted 16 December 2013 - 01:17 PM
Ajt86, on 16 December 2013 - 11:15 AM, said:
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)
rednet.send(id, msg)
#4
Posted 16 December 2013 - 02:22 PM
Castform, on 16 December 2013 - 01:17 PM, said:
Ajt86, on 16 December 2013 - 11:15 AM, said:
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)
rednet.send(id, msg)
#5
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!
#6
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!!!!")
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











