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

Mining Turtle Persistence

Started by campicus, 22 August 2013 - 05:55 AM
campicus #1
Posted 22 August 2013 - 07:55 AM
My server crashes now and again stopping all of my computer programs. Every time my turtle moves it records its x,y,z and direction in a file, so that it can call on this info if the server resets.

My question is, is it possible to run the 'return' code when the server boots back up? From what I can see you need to click a computer to turn it on, to even run the "startup" code. Which means I still have to go and find my turtle each time. Pastebin links to my mining code and the startup code below.

SpoilerStartup:
http://pastebin.com/CtJ6YUVE

Actual mining program:
http://pastebin.com/CfDr1uNr
Zudo #2
Posted 22 August 2013 - 11:09 AM
Have a file which the program reads to check if it was interrupted?
campicus #3
Posted 22 August 2013 - 08:08 PM
Yep I do have that file, if the turtle was interrupted then the "GPS" file will exist (if it finished it's job that file wont exist). I actually think this is solved, as last time the server restarted the turtles automatically ran their startup code when I went to the chunk the turtle was in (even though it is chunk loaded). So I guess that is good enough, if they resume when I got to the chunk