Programming a Turtle

C

Culprit

Guest
I just got into modding, and got the direwolf20 pack. I have my base set up, with a SAG mill powered by a Stirling generator, a electric furnace powered by a generator, and my smeltery. I found this AMAZING cave that I got to the bottom, and just looked around and there was gold and lead and every ore imaginable. So I made a Turtle to do that mining for me. How should I program it to dig a hole to y12 and then make a strip mine 1 blocks high that senses any ores around it in a 3x3? Also what happens if it runs out of fuel at the bottom of the mine? Will I have to go get it? I have a bat morph so I could go in one high but I would have a hard time finding it. Any good programs? Also going to equip it with a chunlloader, how do you do that?
 
Last edited:

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
I usually recommand http://www.computercraft.info/forums2/index.php?/topic/7675-advanced-mining-turtle-ore-quarry/ for mining. A couple of caveats. You will need to externally chunk load the area it is working in. Also, make sure to name the turtle using the label command. By naming the turtle you are enabling it to remember how much fuel it has as well as the program code you put into it. Lastly, server restarts (exiting the game in SP) may cause the turtle to get off a block. This can be avoided by setting up a GPS with computer craft.

Coal is good place to start for fuel. You may want to automate pulling coal out of the dump chest and into the fuel chest. Once you get far enough along you may want to switch to lava cells.
 
C

Culprit

Guest
So I should just put the chunkloader above the turtle? What if it goes outside the loaded chunk? How do I name the turtle with the label command? What does causing
the turtle to get off a block.
mean? How should I set up a GPS?
 

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
I would use the chicken chunks chunk loader and just make it large enough to cover the area the turtle will be mining. You specify the size of area when you setup the turtle. I would start small just to test it and make sure you are comfortable with how it works (one chunk 16) is a good place to start.

As for the GPS it is one of the 1st things you can do with a turtle. You will need 4 computers and 4 wireless modems (I think a blank disk and diskdrive is also required). The turtle should a wireless mining turtle. for your quarry and for doing the GPS deploy. Make sure the turtle has about 500 or so fuel. It will need to go almost up the build limit and deploy the computers

More info
The script I use for GPS is here: http://pastebin.com/XnHCpGae
 

lenscas

Over-Achiever
Jul 31, 2013
2,031
1,808
248
look at the chunkloader from peripherals++, it should be able to be combined with a turtle to make a chunky turtle. (alternatively, search in NEI for chunky turtle and you can see how to make one)

As for mining scripts, a turtle is HORRIBLE at mining like a quarry due to its slow moving and turning speed and very limited inventory. Sure, its cheap but there are more effective ways to make a turtle mine, especially when you have access to chunky turtles and enderchests from the enderchest mod.

So, what is this better way of mining you may ask, well let me explain. This script uses a chunky turtle that will send all its items back to base and will forever and ever mine into 1 direction. The result? A mining machine that will mine forever. This means it won't waste time turning and it will *always be able to mine 3 blocks per time it moved. Because any moving action takes time being able to dig 3 times for each block is very important if you want your resources sooner rather then later.

However, this script comes at an cost as it will need some setup back at base. First off, you will need 3 enderchests. One will be used for the turtle to get fuel. Another one will be used to send items, the turtle will only deposit items into this chest if its empty and thus will only mine further if the chest is empty. The third enderchest is placed inside the turtle itself and the turtle will automatically switch to the correct color combination (it should be relative easy to reconfigure the set color codes if you want).

Note however that because you are still using a turtle resource collection will still be relative slow. However, if you are on a server DO NOT under any circumstance underestimate the amount of resources this thing can get you while you are sleeping and dreaming about the next thing to do on said server. So, without further delay, here is the script (along with some details about how I set it up on that server)

*1: the random generation may make it so that it mines a bit less if no blocks are generated where this turtle wants to mine. Blame Notch for that one :p
 
C

Culprit

Guest
Hmmm, @lenscas I think I'm going to go for the first one as of right now, just because I don't have enough ender pearls for three ender chests, and that way I can just get it going, after I get some ender pearls I'll go ahead with that idea. @Henry Link
I will make a chunky mining turtle like lens as suggested, and then use that program. Is GPS required for that program?
 

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
No the GPS isn't required for @lenscas solution. Since his is just put the turtle down and let it go forever. My solution requires the GPS to ensure the turtle stays on track during server resets. It needs it to ensure that it doesn't lose track of where it is at and to know where it must return to for fuel and drop off.

That being said you don't need the GPS to deploy it. You must give the turtle its starting co-ordinates (use F3 standing on the turtle and use where your feet are at). The GPS deploy program will take that info and place four computers (GPS satellites) about y=248 then come back to where it started. Then you can use the mining program with GPS.

Also, keep in mind the mining program can work without GPS. But, I would keep the area smaller and make sure there isn't any server reboots or exiting the SP game until it is finished. If the area is chunk loaded then you can do other things while it is working.
 
C

Culprit

Guest
Hmmmmm, so i can put four computers in it and give it its starting coordinates and it will place the four computers where it needs to and then come back? and I can then run your program @Henry Link and I can make it a chunky mining turtle which means it will constantly be chunk loaded right
 

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
No really. The problem is the turtles only have two expansions on either side. The pick is on one and the wireless modem needed for the GPS is on the other. So no chunky. If you elect to go without the GPS then sure you can make a chunky. But you run the risk of the turtle moving during a server reboot or game exit and it will be off a block and will not return to the correct place to get fuel and drop items. Which means you will loose the items it mines and it will eventually run out of fuel and will be stuck somewhere in between the mining layers and you have to go hunt it down. Not a good idea due to darkness and mobs.
 
C

Culprit

Guest
Ok, so you still haven't answered my question. Will it make its own GPS of I put in four computers?
 
C

Culprit

Guest
Ok great! Sorry for being a noob but as I said I'm new to modding... don't know everything about vanilla either, what's world coordinates?
 

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
Use F3. You want the x, y & z coordinates of the turtle before you launch it to deploy the GPS. It is best to stand on the turtle after you place it then use the coordinates for your feet. Don't use your eye/head level coordinates.
 
C

Culprit

Guest
So if I morphed into a bat which is one block high then that would work? And just enter the coordinates I assume into the urtle
 

Henry Link

Popular Member
Dec 23, 2012
2,604
553
128
USA - East Coast
You don't need to morph. Just your feet location on the F3 screen when standing on the turtle. Even as a bat morph your eyes will still be in the block above the turtle and your feet position will be the same which is inside of the same block as the turtle is because the turtle doesn't take the entire block.