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

Auto-Restart computers after a Server restart?

Started by MrObsidy, 18 January 2016 - 06:56 PM
MrObsidy #1
Posted 18 January 2016 - 07:56 PM
Heya!
I own a server which is Highly reliant on computercraft. And if a chunk unloads, the computer get's unloaded aswell. However, in my custom modpack I have
Railcraft which provides World anchors so that's not a problem.

But I still have one Problem:
If i restart the Minecraft Server, all chunks get forcidly unloaded. Meaning all PC's turn off.
That wouldn't be too much of a problem if the PC's would turn on as soon as a chunk loads. But that's not tha case, so here is my question:

Is it possible to turn on computers as soon as a chunk gets loaded? Otherwise I could scrap the Internet I am working on since I would have to
open up the streets everytime to restart all routers etc.

Greetings
Obby
KingofGamesYami #2
Posted 18 January 2016 - 08:06 PM
They should turn on as soon as the chunk loads. However, there's a (so far impossible to track down) bug that causes this behavior. How are you restarting the server? IIRC, improperly shutting down a server is one of the probable causes of this bug.
MKlegoman357 #3
Posted 18 January 2016 - 08:06 PM
Computers that were turned on before a chunk was unloaded should turn on after a chunk is loaded again. What CC and MC versions are you using?
MrObsidy #4
Posted 18 January 2016 - 08:13 PM
@MKlegoman357 I am using MC1.7.10, this Modpack.
EDIT: I am using CC 1.75. Forgot to put that in so here ya go.
@KingodGamesYami just using the normal "stop" command. (I host the server on my own PC/Server but IDK what IIRC is/means.)
Edited on 18 January 2016 - 07:18 PM
Lupus590 #5
Posted 18 January 2016 - 08:28 PM
Use this as a workaround http://www.computerc...uter-activator/

You can use an autonomous activator if you have thermal expansion installed

(I'd use both, they you only have to make one auto-activator)
Edited on 18 January 2016 - 07:28 PM
MrObsidy #6
Posted 18 January 2016 - 08:31 PM
Okay, I did a self-test, and this is what happened: I was running 6 PCs, and after the Restart, Only one of them was still on. So now I will check LDDestroier's "on".

EDIT: Semi-Worked. So it did turn all computers, but only under these Circumstances:
1. They had to be connected as a Peripheral,
2. They could only fire up one "Wire-Tree."

Solve:1: Oh well, turn everything to Peripheral Mode.
Solve:2: Well, See, My network has routers and repeaters, so unfortiounately no fix for that!

EDIT #2:
A "wake on lan that supports routers inbetween two trees" would work just fine as well, so I just set up a pc at my base, boot it up and done.
But Like I said there is no WoL out there that fits my requirements :/. Any Ideas?

EDIT #3 (I overedited this post, ikr):
Edited on 18 January 2016 - 08:03 PM
Lupus590 #7
Posted 18 January 2016 - 09:32 PM
have your routers/repeaters run the on script before they start their routing/repeating


--#startup file
shell.run("on")
shell.run("repeat")

Edited on 18 January 2016 - 08:34 PM
MrObsidy #8
Posted 19 January 2016 - 05:56 AM
Well Onfortiounately "on" is an acutal Program that YOU have to terminate and not a script that terminates itself after running, if you get my problem
Lupus590 #9
Posted 19 January 2016 - 08:48 AM
modify it, that is one of the joys of lua, you can read the source

or look into the parallel api
Edited on 19 January 2016 - 07:49 AM
MrObsidy #10
Posted 19 January 2016 - 12:01 PM
Not a bad Idea. I will probably just take "on" and take the GUI bits out so it starts every avaiable computer and thats it!

Not a bad Idea. I will probably just take "on" and take the GUI bits out so it starts every avaiable computer and thats it!EDIT:I have an Idea. On top of every normal router, I put a reguar pc solely for turning on the other pcs!
Edited on 19 January 2016 - 11:02 AM
Lupus590 #11
Posted 19 January 2016 - 01:59 PM
or check that on doesn't have a hidden feature:

Feature suggestion, run a file after turning on all computers

Done. It's in the config (which I should make more obvious in the menu).
To have a program run on startup, set 'startupProg' to the path of the file (with arguments like "less -d butt -u http://pastebin.com/R4DKXbzm") in the config file ('/.on_conf').