This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TheTalon's profile picture

Sending A File To A Turtle From A Computer

Started by TheTalon, 24 February 2012 - 10:31 PM
TheTalon #1
Posted 24 February 2012 - 11:31 PM
I am currently having problems finding a way to get computers to send a program to a turtle, so is there any simple way to do that without having to stop the private server i run to put on APIs or new OSes or such? Im trying to keep from having to use rednet but if its the only way ill try it out.
Liraal #2
Posted 24 February 2012 - 11:37 PM
You actually can do that, just define a variable like a=function() print("HEY") return true end then send it and call it like a(). Not sure whether rednet would handle this, however.
Im making a net library now, so if you dont mind some waiting time i can put it up a function for this tomorrow or so.
TheTalon #3
Posted 24 February 2012 - 11:44 PM
I can't say i understand how that would send a program from a computer onto a turtle.
Casper7526 #4
Posted 25 February 2012 - 12:24 AM
You can have the turtles collect a program from a diskdrive ?
TheTalon #5
Posted 25 February 2012 - 12:31 AM
Okay, but how would i go about doing that? I've tried using copy but i cant seem to find out how to get it to copy off of the disk, and i have seen that copy from post but it wasn't much help because i couldn't get the suggested copy format to work.
coolblockj #6
Posted 25 February 2012 - 01:14 AM
Two ways you could collect files from a disk drive:
In a script:
fs.copy("disk/yourfile", "copiedname")
shell.run("cp", "disk/yourfile", "copiedname")

Using the copy program just type on the desktop:
cp disk/yourfile copiedname

I could be wrong but thats how i do it :P/>/>
TheTalon #7
Posted 26 February 2012 - 06:27 PM
Thanks a bunch coolblock, it works perfectly.