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

Dynamic Turtle Placement For Mines

Started by Robin1225, 24 January 2013 - 05:22 PM
Robin1225 #1
Posted 24 January 2013 - 06:22 PM
I have an idea about a progressive mining program that doesn't stop until there is user intervention. Do note that everything said below is hypothetical and have not been written yet, so don't ask for code implementations quite yet.
Quite simply, I want to have multiple turtles mining the area at once and when they have finished their allocated area, deposit items, check fuel, and automatically move on to the next area that needs to be mined.
This program will rely on rednet communication between all turtles and a central computer that will display information/problems from the turtles and allow turtles to effeciently choose the next area to be mined; however, I want to allow turtles to be added to the mining operation without stopping all turtles and restarting all of the program.

A simple solution:
Lets say moving a turtle finished a mine that is 8 blocks is width and length. Then shifts to the next mine after returning to start position and doing turtle.forward() 9 times and starting another mine.
But, this does not work in my application because multiple turtles will interfere with this mining design. Of course, I could assign lanes and the turtles will never fail, but to maximize efficiency, it would be idea to have turtles that mine around you instead of a straight line as to prevent chunk unloading.

A more complicated(and fun) solution:
Would it be possible to have turtles communicate the position of the next mine and have new turtles position their next mines efficiently next to other mines that other turtles are mining. That was a mouthful. This is probably really confusing so, I shall provide another example:
12 turtles are mining the area around the central computer/processing center and I get enough resources to craft and add another turtle to the program (without ever stopping/ restarting the program), how would the turtle be able to position itself to start the next mine without interfering with the current processes of other turtles. Basically, how would a turtle pick a new area to mine taking note of all of the other mined areas/ areas that will be mined by other turtles.

Any ideas?

Thanks
-Robin
etopsirhc #2
Posted 24 January 2013 - 07:51 PM
the simplest solution i see is have all the turtles have 2 program , one is a startup one that will receive a simple command to go to x,y,z from its position , then that program would run another to actualy do the mining at that location

then have another turtle that placed the ones i mentioned first , all it does is place them , turn them on , and broadcast a message to them to their mining positions ( only the most recent placed one would be listening )

the mining program as well as the positioning could be done in any combo and style from there, such as a grid excavate after placing its starting chest or mine shafts 3 tall spaced 2 appart around level 11 ( this way u can go though the tunnels after with a fortune pick to get tons of diamonds )
ChunLing #3
Posted 24 January 2013 - 08:26 PM
I wrote a remote control program that I started to move in the direction of having enough feedback and functions to allow it to be a way for a master control computer to use several turtles, having them move, execute programs, or other such things. I never really got around to writing the master control, though. I tend to prefer to remotely control the turtles myself.

The thing is, the way I figure it is that the more autonomous you make the turtle (like having them run programs and such rather than doing more basic commands) the less feedback you get for the master control computer to build a picture of how everything is going.