4 posts
Posted 25 September 2012 - 03:20 AM
How would I send a file though a computer, and then run it on a turtle?
475 posts
Posted 25 September 2012 - 04:02 AM
You will need to read the file and send it though rednet. Here's a quick example:
f = fs.open("/filetosend", "r")
sFile = f.read()
f.close()
rednet.send(id, sFile)
4 posts
Posted 25 September 2012 - 04:29 AM
Thanks! But how do I run it on the turtle when it receives the file?
475 posts
Posted 25 September 2012 - 04:46 AM
You would need to do:
id, msg = rednet.receive()
f = fs.open("tempfile", "w")
f.write(msg)
f.close()
shell.run("/tempfile")
4 posts
Posted 25 September 2012 - 05:14 AM
You will need to read the file and send it though rednet. Here's a quick example:
f = fs.open("/filetosend", "r")
sFile = f.read()
f.close()
rednet.send(id, sFile)
it says
:2: attempt to call nil
when i try to run it
105 posts
Posted 25 September 2012 - 06:12 AM
Did you give it a valid file path to read?
288 posts
Location
The trashcan where all Undertale trash is
Posted 25 September 2012 - 11:23 PM
sFile = f.read()
Now there's your problem. f.read() is not a valid function. f.readAll() should wor
k.
475 posts
Posted 26 September 2012 - 12:02 AM
sFile = f.read()
Now there's your problem. f.read() is not a valid function. f.readAll() should wor
k.
Oh woops
4 posts
Posted 26 September 2012 - 01:13 AM
Thanks guys! It worked perfectly.