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

Rednet Movie Help!

Started by timyo24, 25 September 2012 - 10:59 PM
timyo24 #1
Posted 26 September 2012 - 12:59 AM
Hey guys, I have a program to run the alongtimeago program when it receives a rednet message from the control terminal. The problem is i need a command so that when the movie finishes, the Terminal prints a goodbye message, and reboots. If anyone can help, I'll post my code below! Thanks! :P/>/>


rednet.open ("back")
while true do
e, id, msg = os.pullEvent()
if e == "rednet_message" and id == "19" and msg == "Play" then
shell.run ("monitor", "back", "secret/alongtimeago")
end
end
rednet.close ("back")
Cranium #2
Posted 26 September 2012 - 01:00 AM
after your shell.run(:monitor","back","secret/alongtimeago"), you can add shell.run("reboot"). It does exactly what you are looking for.
Noodle #3
Posted 26 September 2012 - 01:17 AM
after your shell.run(:monitor","back","secret/alongtimeago"), you can add shell.run("reboot"). It does exactly what you are looking for.
os.reboot() is faster.
After shell.run add print("Goodbye!") os.reboot()
hego555 #4
Posted 26 September 2012 - 08:07 AM
after your shell.run(:monitor","back","secret/alongtimeago"), you can add shell.run("reboot"). It does exactly what you are looking for.
os.reboot() is faster.
After shell.run add print("Goodbye!") os.reboot()

ROFL micro-optimizations,

Why not just make it restart program instead of computer?