Posted 06 November 2012 - 04:46 PM
I am attempting to use the rednet system to network computers together, and I could simplify my code greatly if I could figure out how to set a string to a portion of a string.
For example:
lets say a rednet.broadcast() sent the string "send1 test message"
id,message = rednet.receive()
messagefirst = [the first five characters of message]
messagelast = [the rest of the message]
if message first == "send1" then print(messagelast)
Is this possible in LUA?
For example:
lets say a rednet.broadcast() sent the string "send1 test message"
id,message = rednet.receive()
messagefirst = [the first five characters of message]
messagelast = [the rest of the message]
if message first == "send1" then print(messagelast)
Is this possible in LUA?