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

Resume, Remote Control

Started by Williambeene, 29 January 2013 - 08:46 AM
Williambeene #1
Posted 29 January 2013 - 09:46 AM
Hello, This is my first post to this forum.

I have been playing with turtles for about a month now and I love them. Unfortunately there are a few questions I cant seem to find answers to.

I would like to know how to make a resume function or small program I can call, so when our server restarts I can A.) login to the turtle via rednet and press a key to resume its task (such as returning to excavating) B.) Regaurding gps, I understand it takes four terminals to create a gps network and that there is a maximum height and distance for a gps system, My question is if there is a way to relay this gps location information without having to build a new gps array?

Thank you all for your help in advace.

turtle.dance()
;-)

Will
OmegaVest #2
Posted 29 January 2013 - 10:01 AM
Firstly, you can make a resume program, though that requires that you constantly save certain information, such as your loop iteration, and what task they are actually on.

So, say you are making a quarry that spirals inward, returns to the start of that spiral, then goes down.You need to save, in this order (reverse, possibly, depending on your extractor): task, depth, max depth, current side length, current side, current location on that side, maximum side length and … I forgot what the last one was, and I can't find the program I wrote for it.

Anyway, once you know what information you need, all you have to do is put them in a file, and then when the terminal/turtle restarts, have it look for that file and unpack it. Make sure to delete or clear the file after unpacking it, however. Unpacking is also a little more. . . difficult to do, since it requires activating each part of the loop individually, and for a specific amount of time, and then returning to the start of the spiral, dropping down and beginning a new spiral.

Wow that got complicated. I suppose it would be simpler to use a 2x2 miner program, since you could just pick that up wherever it was, and just tell it to go back up to the top once it was done. You'd only need to save depth and start depth, and make sure the turtle clears out the first layer anyway.


And for the GPS arrays: No. As soon as the turtle passes out of array range, you need another array. Also, height and distance are the same thing with GPS, as the radius is in a spherical shape, not an actual square.