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

Is it possible to boot a computer or turtle and run a program remotely?

Started by Edam Bythemine, 16 September 2012 - 07:00 PM
Edam Bythemine #1
Posted 16 September 2012 - 09:00 PM
I have a turtle that is part of a more complex machine, and I want to start a program saved in the turtle from a computer in a close area. How would I program this?
Thank You.
Lyqyd #2
Posted 16 September 2012 - 09:12 PM
To answer both questions in the title of your post:

It is possible to boot a computer/turtle from another computer/turtle touching it (the combination of turtle and computer is irrelevant), using the peripheral API.

It is possible to use rednet to instruct a remote computer to run a program, so long as the remote computer is running a program that is designed to accept rednet packets and run programs based on their contents. There is at least one tutorial in the Tutorials section and several complete programs in the Programs section, as well as the Turtle Programs subsection.
EmTeaKay #3
Posted 17 September 2012 - 04:50 AM
I haven't tested this, but it should work.

--Put this into sender
print("Enter ID of sender: ")
id = read()
print("What would you like to send: ")
msg = read()
rednet.send(id, msg)
end
--Put this into receiver
id, msg = rednet.receive()
print(msg)
if msg == "runClear" then
shell.run("clear")
end