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

rednet and strings

Started by protexxi, 10 December 2013 - 03:53 PM
protexxi #1
Posted 10 December 2013 - 04:53 PM
When useing rednet i have used

rednet.receive()
a message will be sent from a turtle using

rednet.send(1, Hello world)
Is there a way to print a string into the message e.g

turtle.dig()
blocksdug = blocksdug + 1
rednet.send(1, Block Dug:[blocksdug])

thanks again
Lyqyd #2
Posted 10 December 2013 - 05:09 PM
Your first example should be:


rednet.send(1, "Hello World")

To answer the question, you simply concatenate them like any other string.


rednet.send(1, "Block Dug: "..blockDug)

You should google "Lua concatenation" to learn more.