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

Problem with os.reboot()

Started by bruno1o9, 17 May 2015 - 01:06 PM
bruno1o9 #1
Posted 17 May 2015 - 03:06 PM

   if userinput == "1" then
    redstone.setBundledOutput(side, 16)
    print("Lights are turned on.")
    os.reboot()
   end
 
  

Does anybody know why it jumps directly to os.reboot() and skips the rest? It worked yesterday but today this part is giving me headache..
Lyqyd #2
Posted 17 May 2015 - 05:44 PM
Moved to Ask a Pro.

Please post the whole script.
Dragon53535 #3
Posted 17 May 2015 - 06:25 PM
It doesn't jump directly to os.reboot(). It does what you ask, however it happens so quick you see nothing else. Also, the reason why the redstone signal is not showing, is because when a computer is turned off, it does not emit a redstone signal. So it quickly tries to send out a signal, then sends out no signal after the reboot. If I'm wrong then you might be setting the bundled output at the top of your script.
Anavrins #4
Posted 17 May 2015 - 09:22 PM
I would suggest adding a small sleep() before calling os.reboot().
dan200 #5
Posted 20 May 2015 - 08:46 PM
All redstone outputs are turned off when the computer shuts down/reboots
Lyqyd #6
Posted 21 May 2015 - 01:08 AM
Looks like this thread may have been accidentally locked (as it is in Ask a Pro, and no longer in Bugs), so I'm re-opening it in case OP has further questions about redstone outputs and computer power states.