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

Automatic startup

Started by Xelostar, 21 August 2016 - 05:01 AM
Xelostar #1
Posted 21 August 2016 - 07:01 AM
I was wanting this functionality to I could walk into my previously unloaded house, and all my obviously unloaded computers would turn on and start doing their stuff without requiring me to turn all of them on.

If this can't happen, I'll have a turtle I can just right-click on and it will be simply instructed to turn on all the computers.

A response from a mod/a link to a duplicate thread I have not found any of would be helpful.

Computers DO start when the chunk is unloaded then loaded.

I also want a functionality for computers to start on their own. If the world is running on a server and the server gets restarted, all computers will be forced to turn off. It would make more sense if they kept running. Is it possible to create an option in the config file for computercraft for this?
Luca_S #2
Posted 21 August 2016 - 12:08 PM
If you want the computers to keep executing code while the server is offline, that's impossible afaik, because the process that emulates the computers stop, if you mean that the computers that were on before the server restarted start up again, I am not sure if that is already in there, but it would make some sense
valithor #3
Posted 21 August 2016 - 08:48 PM
If you want the computers to keep executing code while the server is offline, that's impossible afaik, because the process that emulates the computers stop, if you mean that the computers that were on before the server restarted start up again, I am not sure if that is already in there, but it would make some sense

Any computer that was on before the restart, and has a startup file will turn back on. If it does not have a startup file then it will not turn back on when the chunk loads. I cannot personally see any reason for any computer that does not have a startup to turn back on.

If he was talking about states, similar to how open computers will save states between server reboots, if i remember correctly would either require a lot of work or is not possible with the current lua implementation.

Do keep in mind this is a three year old thread about something completely different than what he is wanting to do. It would be better if a new thread were created with this suggestion (although i can't see any benefit of computers without startup turning back on, and saving states will likely not be implemented).
Edited on 21 August 2016 - 06:50 PM
SquidDev #4
Posted 21 August 2016 - 09:18 PM
Any computer that was on before the restart, and has a startup file will turn back on. If it does not have a startup file then it will not turn back on when the chunk loads. I cannot personally see any reason for any computer that does not have a startup to turn back on.
Do you have a source for this? I'm looking at the code and I can't see any startup file checks. (Though I can't see any reason why computers don't turn on when they are meant to so…).
Bomb Bloke #5
Posted 22 August 2016 - 04:30 AM
Long story short, valithor is mistaken.

The deal is that if a computer was on when its chunk was last unloaded - be it because all users moved away from it, or because the server shut down - then it should turn itself back on when the chunk reloads. Full stop. If the system has a startup file it'll then execute that from the beginning, if it doesn't then it should simply load up the CraftOS shell prompt, either way it should turn back on if it was on before.

In many cases, systems will not turn on when they should. This isn't decided by any sort of setting; it's a bug. This may happen because the server was not shut down correctly… but most often, there's no obvious explanation for it.

Under later versions of CC (anything for MC 1.8+) I haven't been able to get systems to turn on automatically in any SMP worlds, even with no other mods, yadda yadda. Though given the random nature of the bug, it wouldn't surprise me if it works for other users.

But yeah, if you're not using startup files you're not going to get very far either way.
Edited on 22 August 2016 - 02:38 AM
TheRockettek #6
Posted 22 August 2016 - 08:04 AM
If you have thermal expansion you can use an autonomous activator to automatically right click it. :P/>
Xelostar #7
Posted 24 August 2016 - 08:36 AM
It's not working for me. If I leave a computer on and restart the server, the computer will be turned off. The computer does have a startup file. (Probably a bug)

If you have thermal expansion you can use an autonomous activator to automatically right click it. :P/>

Thank you! That's an amazing idea. I wanted to have some server computers running and this is the solution! :)/>
TheRockettek #8
Posted 24 August 2016 - 08:51 AM
If your doing it on a server (like lurcraft) where there is plot or a server with some area protection, the autonomous activator may not work. If it doesnt (sometimes the owner makes it that is does work) then if you can trust other players you can trust the fake player which is [CoFH] (Include the square brackets, this symbolizes a fake player). If you cant trust others and is a protected area (such as in a modded skyblock server), just contactthe owner :)/>.
Bomb Bloke #9
Posted 24 August 2016 - 09:59 AM
Are you certain you're restarting the server correctly? Some people have reported that they can reproduce the problem by closing the server window with the X, whereas entering the "stop" command avoids it.
Xelostar #10
Posted 24 August 2016 - 08:32 PM
If your doing it on a server (like lurcraft) where there is plot or a server with some area protection, the autonomous activator may not work. If it doesnt (sometimes the owner makes it that is does work) then if you can trust other players you can trust the fake player which is [CoFH] (Include the square brackets, this symbolizes a fake player). If you cant trust others and is a protected area (such as in a modded skyblock server), just contactthe owner :)/>.

Ik have made my own modpack and my own server with my friends. :)/> Therefore, that can't be the problem.

Are you certain you're restarting the server correctly? Some people have reported that they can reproduce the problem by closing the server window with the X, whereas entering the "stop" command avoids it.

I always do turn off the server using the "stop" command. Somehow it doesn't work without an autonomous activator. :mellow:/>
Thank you for helping, though. :)/>