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

Autoshutdown program? Solved

Started by Emilgardis, 29 July 2012 - 08:35 PM
Emilgardis #1
Posted 29 July 2012 - 10:35 PM
How would that be possible.

I want to make my computer autoshutdown after aprox. 5 minutes so that it launches startup after boot.

Sorry for the short post but that is really all.

::EDIT:: Oops. didn't thinkabout the search function.
Rsstn #2
Posted 30 July 2012 - 09:37 AM
You could either use


os.shutdown()

so that the computer would start again when somebody uses it, or you could use


os.reboot()

which would restart the computer and its 'startup' program immediately.
Emilgardis #3
Posted 30 July 2012 - 01:00 PM
You could either use


os.shutdown()

so that the computer would start again when somebody uses it, or you could use


os.reboot()

which would restart the computer and its 'startup' program immediately.
Yes. But that would still not work.
Rsstn #4
Posted 30 July 2012 - 03:14 PM
Oh, so you mean that you want the computer to shut down if you don't use it for 5 minutes or more? That would require a program running in the background the whole time. I'm not sure that's possible, unless you edit the BIOS.
Lyqyd #5
Posted 30 July 2012 - 06:34 PM
You could either use


os.shutdown()

so that the computer would start again when somebody uses it, or you could use


os.reboot()

which would restart the computer and its 'startup' program immediately.
Yes. But that would still not work.

Why not? How do you propose to shut it down without using the os.shutdown() call? The five minutes of inactivity part is easy.