3 posts
Posted 24 February 2012 - 01:52 PM
Hello, I'm trying to run a command (eg turtle.back ()) using the rednet. however so far without success. Could someone help me?
473 posts
Location
Poland
Posted 24 February 2012 - 02:48 PM
That's, to say the least, problematic. The thing is that what you can send over rednet is a string. To actually execute a function it needs to be code. I haven't yet found a way around this. However, if you can pre-program all the functions/commands into files already present in the receiver's file system, you can use something like that:
local path=NAME -- swap NAME for path to the program to execute. ofc you can have many of these
while true do
local e, i, m=os.pullEvent()
if a=="rednet_message" and m==path then
shell.run(path)
end
end
If you run this, just send to that terminal the path entered in the first line of code.
if you want more options, just duplicate the 'if' section.
18 posts
Location
My Computer. Possibly, my computer inside my computer.
Posted 26 February 2012 - 08:49 AM