1 posts
Posted 14 February 2013 - 01:27 AM
Topic: Control mining turtles from one computer
How would I go about controlling turtles around my world (starting/ending programs) with a computer at my home base. I have Wireless modems attached to both devices.
818 posts
Posted 14 February 2013 - 02:41 AM
Turtle code:
rednet.open("right")
computerID = 0 -- Change 0 to your computer ID
while true do
id,message,distance = rednet.receive()
if id == computerID then
shell.run(message)
end
end
Then you can simply send what program to run with which arguments to the turtle.
8543 posts
Posted 14 February 2013 - 07:11 AM
You could also try using something like
nsh if you want a more interactive sort of control. With nsh, you can upload and download files, and even edit files on the turtle from the computer!
If you are looking for information about how to code this yourself, the general starting point is to have a program on the turtle that listens for incoming commands and executes them. Something really basic like:
rednet.open("right")
while true do
id, message = rednet.receive()
shell.run(message)
end
Or like what Doyle posted, which includes ID filtering.