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

Send Variable Over Rednet...

Started by hbomb79, 19 June 2014 - 05:39 AM
hbomb79 #1
Posted 19 June 2014 - 07:39 AM
I keep trying but for some reason the computer im sending it to keeps giving me an error

Sending Computer Code

rednet = "Hi"
rednet.send(7,rednet,"Missile")

Receiving Computer Code

print "Message Details: "
	print ("SenderID: "..id.."")
	print ("Message: "..message.."")
	term.setTextColor(colors.purple)
	 print "====================================="
	end

Error Im Getting :
Attempt To Concatenate Table And String
Edited on 19 June 2014 - 05:40 AM
wieselkatze #2
Posted 19 June 2014 - 08:54 AM
The problem is, that you named your variable rednet. Rednet is the table of functions of the rednet API. Rename your variable you want to send.

Also in both computers you forget to open the modem with rednet.open(side)
On the receiving computer there is also a

id, message = rednet.receive()
needed to actually get the mesaage.
hbomb79 #3
Posted 19 June 2014 - 09:26 AM
I have added rednet.open() The program is 1000 lines long and i only reproduced the code in theis post, thanks tho, although i figured that out right after i posted :/