Can Mining Turtles Resume When Logging Back In?

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Danwatson

New Member
Jul 29, 2019
77
0
0
Oh yeah, I have been wondering about something else as well. After mining alot with my turtles I have come to realise that the ores on the walls are left, is there any way that the turtle, after finishing excavating get all the ores that are left on the side of the crater? Would that be possible?
It may just be a stupid question and I believe the answer is no but honestly, is that possible?
 

Danwatson

New Member
Jul 29, 2019
77
0
0
Danwatson for anything CC related check out computercraft.info ;)
http://www.computercraft.info/forums2/index.php?/topic/7675-advanced-mining-turtle-ore-quarry/

If you dig through that post (around page 6-8) the author posts a pastebin link for a beta version that includes resume support. It works flawlessly from what I have experienced the last twenty times I ran it.
Well after taking a look and watching his extensive tutorial video that was surprisingly helpful I have come to the conclusion that I will test it out and follow through the steps he took. I did not hear him talk about the resume system and so I am not sure how that would work. Did it work for you when you ran the programme? Did when you log back in the turtle just resumed mining instead of rebooting itself?
Anyway, thankyou for your suggestion, it has helped, alot :D
 

Danwatson

New Member
Jul 29, 2019
77
0
0
Danwatson for anything CC related check out computercraft.info ;)
http://www.computercraft.info/forums2/index.php?/topic/7675-advanced-mining-turtle-ore-quarry/

If you dig through that post (around page 6-8) the author posts a pastebin link for a beta version that includes resume support. It works flawlessly from what I have experienced the last twenty times I ran it.
Well after some testing in my test world I have come across a problem. After the turtle finished unloading his items while mining he stopped. The interface says 'Too Long Without Yielding'. Have I done something wrong or is it something in the code that is not working?
 

Jarl

New Member
Jul 29, 2019
14
0
0
If I understand it correctly CC programs need to yield to other programs or at least give them a chance to run. Or something like that. All you need to do is stick a sleep(0) somewhere in one of the loops.


The resume system in in beta at the moment and has a different code than the one in the OP.
Specifically it is here: http://www.computercraft.info/forum...tle-ore-quarry/page__view__findpost__p__77145

I stuck my sleep(0) at line 849 when I ran into the yielding problem. It only happened once while I was on a server though. Shrug.
 
  • Like
Reactions: biomirth

Danwatson

New Member
Jul 29, 2019
77
0
0
So what your suggesting is that I edit the program and tell it to sleep once and I wont run into that error anymore? If so then thanks!
 

Hawcian

New Member
Jul 29, 2019
40
0
0
Oh yeah, I have been wondering about something else as well. After mining alot with my turtles I have come to realise that the ores on the walls are left, is there any way that the turtle, after finishing excavating get all the ores that are left on the side of the crater? Would that be possible?
It may just be a stupid question and I believe the answer is no but honestly, is that possible?

It's almost certainly possible. There's a built in compare function, so assuming you had the relevant ore blocks to compare to, you could have it search the walls and mine the ores out. The mining program linked earlier uses it to make a much more efficient quarry, mining only what it needs to to find the ores (similar to the vanilla branch mining technique of one block wide tunnels spaced two apart).
 

baw179

New Member
Jul 29, 2019
295
0
0
You shouldn't need anything extra in Austin's program at all. I have been using his latest program for some weeks now and have performed around 30 excavations without any problems whatsoever.

This is the latest pastebin with auto-resume : http://pastebin.com/TRtdTB19

I set it down, normal chest to left with coal in, ender chest behind it to deposit into. Smooth stone in slot 1, soil in slot 2, coal in last slot, wood chest in second to last slot, then run the program "OreQuarry [insert Y level] [insert quarry size]". Make sure the chunk(s) are kept loaded and then leave it to get on with it. I've done a simulated server crash/restart and it's been running again on its own when I logged back in.
 

Danwatson

New Member
Jul 29, 2019
77
0
0
Right, well after coming back after dinner leaving the turtle to work I seem to have run into the same problem again, 'too long without yielding'. I found the turtle underground and it had just stopped, what should I do as I am very confused, please help :(
 

keepmind

New Member
Jul 29, 2019
1
0
0
Danwatson, I have the same problem. And sometimes the server hangs because of OreQuarry. Please help.
Sorry for my english)
 

Harvest88

New Member
Jul 29, 2019
1,365
-1
0
Would it be better to have a small to medium sized RP2 tunnel bore with on board Themopiles, a enderchest, and chunkloader? Or do those things have problems on restarts?
 

TheOatKing

New Member
Jul 29, 2019
5
0
0
As has been stated by a few other people. This could simply be solved by writing a snippet of code for file reading and writing.

All it would have to do is this:
Have the program named 'startup' so that it runs when the computer is turned on ( after a restart, for example )
The first time the turtle runs the program, it checks to see if there is a file at "x" directory. If not, it creates the file ( a simple text file ).
The user would then enter the XYZ coordinates. These would be stored in the file simply one per line. It would look something like
25
100
210

Every move the turtle made would simple update the file with the most current XYZ coordinates.

If, when the turtle starts, it does find the file with the coordinates. It simply injects those into the variables instead of asking a user to manually do it.

That's the easy part. The hard part is making sure it remembers which way it was facing. But that could simply be saved as another file and read similarly.
 

slay_mithos

New Member
Jul 29, 2019
1,288
0
0
One relatively easy way to make turtles resume mining is to have them being able to tell their coordinates.

That means the second upgrade, as well as at least 4 computers to act as GPS hosts.

That alone doesn't make it restart correctly, but it means that you only have to write the coordinates of the "base", width, depth, heigh and direction of your mining operation.
You also need to specifically code a function that will return the direction the turtle is facing, in order to be able to completely compare it's coordinates with what it is doing.


I said "relatively", because without GPS, you need to write way more data to the disk, and to update said data at every single move and turn that your turtle takes, and servers usually don't like it when there are too many IO operations (just saying).
 

Jharakn

New Member
Jul 29, 2019
25
0
0
I've got a mining script that does that too, you can find it here. Like a lot of people above are saying though it needs a gps system set up.
 

baw179

New Member
Jul 29, 2019
295
0
0
Right, well after coming back after dinner leaving the turtle to work I seem to have run into the same problem again, 'too long without yielding'. I found the turtle underground and it had just stopped, what should I do as I am very confused, please help :(

What size are you doing? I never have any issues at all but I keep the square no larger than 25. I've heard people have the yielding error when trying to do them at huge sizes like 64 square. You want to keep them on the small side because the turtle has to path from wherever it is and come back up the shaft to empty out when it's full. If you're doing large sizes then each time it needs to empty out it wastes a ton of time travelling and not digging which defeats the whole point of it.

Another tip is to set a chunk loader down first and display the lasers for 1 chunk. Then put the turtle down in the front left corner for a 16 block square and you'll know that you won't have to worry about the chunk being unloaded when you go off exploring or whatever. It's easier to do it that way rather than placing the turtle down THEN trying to set the chunk loader to cover the excavation area.
 

baw179

New Member
Jul 29, 2019
295
0
0
What exactly is the appeal of using these over quarries?

Early game use in particular. Piece of piss to make with basic mats and with AustinKKs program linked above they're as fast as a quarry for ore mining. What's not to like? (apart from all those damned spiders in the 1 high spaces it leaves :rolleyes: - top tip : don't set it going under or near your base ;))
 

Mash

New Member
Jul 29, 2019
892
0
0
Early game use in particular. Piece of piss to make with basic mats and with AustinKKs program linked above they're as fast as a quarry for ore mining. What's not to like? (apart from all those damned spiders in the 1 high spaces it leaves :rolleyes: - top tip : don't set it going under or near your base ;))

Meeeh. I guess I just prefer quarries due to the inherently low maintenance.

I used turtles early on, but I got away from them as early as I possibly could. I got tired of moving my ender chest every time my minecraft crashed.