Jump to content




rednet and strings


  • You cannot reply to this topic
1 reply to this topic

#1 protexxi

  • Members
  • 51 posts

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

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users