9 posts
Posted 10 March 2012 - 04:28 AM
okay so I have some simple programs but I wan't to have it so that I can use a terminal to turn on a turtle program or to have a message to broadcast what the print("message") says back to my terminal what kind of a code could I use.
18 posts
Location
My Computer. Possibly, my computer inside my computer.
Posted 10 March 2012 - 06:46 AM
Try something like this:
ID, msg = rs.receive(3)
if msg then
loadstring(msg)
end
With this you just send whatever commands you want the receiver to run over rednet, and once it receives them, it will run them. For example, if you sent it print("Hello, World!") then the receiving term/turtle would run it, and print out the message Hello, World!
724 posts
Posted 10 March 2012 - 06:50 AM
loadstring return function, not execute it
473 posts
Location
Poland
Posted 10 March 2012 - 04:39 PM
This should work:
ID, msg = rs.receive(3)
if msg then
local tmp=loadstring(msg)
tmp()
end