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

[Question] Programs stop after quitting

Started by Zalerinian, 29 April 2012 - 03:52 PM
Zalerinian #1
Posted 29 April 2012 - 05:52 PM
Let me start by saying I hop i'm not re-posting, my search didn't seem to show any of the same questions.

My question is, would it be possible to stop a program from shutting down after you quit the game? I'm considering porting this over to a server, but having the GPS running would be a pain if i need to reset it every time the server restarts to refresh its RAM. Is there any way that i can make it so that the programs, or at least select programs, don't stop running?

Thank you kindly,

~Zale
MysticT #2
Posted 29 April 2012 - 06:06 PM
Computer state isn't saved on chunk unload (when you go to far away from the computer/turtle, or you exit the game), it just saves it's on/off state.
You can create a startup file to run the gps, so it starts with the computer. Put this code on the startup file:

shell.run("gps", "x", "y", "z")
replacing the x, y and z values to the ones of the computer.
This could be used for other programs, but they would restart, it's previous progress will be lost if the program itself doesn't save it.
Zalerinian #3
Posted 29 April 2012 - 06:16 PM
Ahh, i think i see what i was doing wrong. I was reading about it on the wiki but I couldn't get it to work right. Thanks :)/>/>