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

Programs Inside Programs

Started by Donaldbean, 24 September 2012 - 11:42 PM
Donaldbean #1
Posted 25 September 2012 - 01:42 AM
How to I run a program like "reboot" inside a program that i have made?
Luanub #2
Posted 25 September 2012 - 01:45 AM

shell.run("program")

To reboot though you can just call

os.reboot()
Donaldbean #3
Posted 25 September 2012 - 01:47 AM
Thanks! I am kind of new to computercraft, but it really peaks my interest :P/>/>
ChaddJackson12 #4
Posted 25 September 2012 - 02:05 PM
Either that or use a function… (Put functions above the code, to be safe, because they didn't work for me when I put them below the code)


function reboot()
 print("Rebooting")
 os.sleep(1)
 os.reboot()
end
-- Put your program stuff below this line
-- Then somewhere inside your code put this where you want to reboot
reboot()

That might not help much with rebooting, but it should help with learning functions, good luck!