Mining Turtle Cylinder Program Help

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

bunnaryben

New Member
Jul 29, 2019
14
0
0
Me and some friends on a server decided to make our base inside of a mountain. We decided to make different levels of a circular pattern for each kind of mod.(One buildcraft, one TC3, one railcraft, ect.). Making each level by hand is fine, but time consuming and boring. I set up a mining turtle to act as a quarry to get resources quick and now it's just floating in the air doing nothing. It would be great if we could use the turtle to finish the job of digging the base, unfortunately we are all computercraft noobs. I was wondering if there is a script for getting the pattern and doing it all the way down to bedrock. It would help a lot. This is the pattern.
2013-03-23_12.30.15.png
 

Skirty_007

New Member
Jul 29, 2019
436
0
1
If you're not great with lua, the simplest option might be to make something that mines straight down and comes back up in a different block, so you can move it to the next place. I'm on my phone right now, and I know it's not the most efficient way, but unless you're willing to have a go at it yourself using the api, I think it's unlikely that someone else will write some code for you. You could increase efficiency by mining all around as it goes down (a plus shape). I'm no coder, but have managed to write some of my own scripts (with a bit of help/advice from someone that is a coder), it's actually not as hard as it seems, unless you're trying to make super efficient code. (I would be able to write something to dig out that shape, I think if you read the api you might manage!)

Good luck!
 

bunnaryben

New Member
Jul 29, 2019
14
0
0
If you're not great with lua, the simplest option might be to make something that mines straight down and comes back up in a different block, so you can move it to the next place. I'm on my phone right now, and I know it's not the most efficient way, but unless you're willing to have a go at it yourself using the api, I think it's unlikely that someone else will write some code for you. You could increase efficiency by mining all around as it goes down (a plus shape). I'm no coder, but have managed to write some of my own scripts (with a bit of help/advice from someone that is a coder), it's actually not as hard as it seems, unless you're trying to make super efficient code. (I would be able to write something to dig out that shape, I think if you read the api you might manage!)

Good luck!

Cool thanks for the help!
 

Neirin

New Member
Jul 29, 2019
590
0
0
The computercraft forums are great for these sorts of querries. I'm pretty sure http://www.computercraft.info/forums2/index.php?/topic/10089-shape-builder/
includes a cylinder builder.
If you'd rather enter the wonderful world of lua you can make a pretty simple program that pretty much just uses movement functions (i.e. turtle.forward()) and turtle.place(). For a tower like this you could just have the turtle make pillars and manually place it at the base of each piller. (Hint: turtles are cheap, particularly if you don't add tools on, you could make a whole fleet of them).
the code would look something like
Code:
for i = 1, <height> do
    turtle.up()
    turtle.placeDown()
end

You could get fancier and pass it height as a variable, but for a starter program, just manually adding the height value to the program is more straight forward. This also doesn't change inventory slots, so it would cap out at 64 blocks tall, but that shouldn't be too big of a problem. The turtle would also end up on top of the pillar, so you'd have to add a way to bring it down. That would look something like
Code:
turtle.back()
for i = 1, <height> do
    turtle.down()
end

The turtle.back() bit is to move it off of the pillar before going down. You could also use turtle.forward() depending on how you placed your turtle.
 

bunnaryben

New Member
Jul 29, 2019
14
0
0
The computercraft forums are great for these sorts of querries. I'm pretty sure http://www.computercraft.info/forums2/index.php?/topic/10089-shape-builder/
includes a cylinder builder.
If you'd rather enter the wonderful world of lua you can make a pretty simple program that pretty much just uses movement functions (i.e. turtle.forward()) and turtle.place(). For a tower like this you could just have the turtle make pillars and manually place it at the base of each piller. (Hint: turtles are cheap, particularly if you don't add tools on, you could make a whole fleet of them).
the code would look something like
Code:
for i = 1, <height> do
    turtle.up()
    turtle.placeDown()
end

You could get fancier and pass it height as a variable, but for a starter program, just manually adding the height value to the program is more straight forward. This also doesn't change inventory slots, so it would cap out at 64 blocks tall, but that shouldn't be too big of a problem. The turtle would also end up on top of the pillar, so you'd have to add a way to bring it down. That would look something like
Code:
turtle.back()
for i = 1, <height> do
    turtle.down()
end

The turtle.back() bit is to move it off of the pillar before going down. You could also use turtle.forward() depending on how you placed your turtle.

That's really helpful besides the fact that's in a mountain going down, meaning digging. I'll check out the link (for some reason that never occurred to me:p). Now I'm really interested in lua and learning too.
 

Neirin

New Member
Jul 29, 2019
590
0
0
That's really helpful besides the fact that's in a mountain going down, meaning digging. I'll check out the link (for some reason that never occurred to me:p). Now I'm really interested in lua and learning too.

d'oh, screenshot made me think building above ground and made me forget what I had just read.

Digging vertical pillars is really easy.
Code:
for i = 1, <height> do
    turtle.digDown()
    turtle.down()
end
 
for i = 1, <height> do
    turtle.up
end
Digs straight down then comes back up to where it started.

Digging a circle is actually kinda complicated since your circle design would either have to incorporate the blocks the turtle has to move through outside the desired circle, or the turtle would have to fill in holes behind itself. Filling in would probably mean you'd have to code a way for the turtle to know when it's digging the circle and when it's digging to get to where it needs to be to keep digging the circle. It's certainly possible, but it's probably easier to hollow out the majority of your cylinder with some sort of quarry (a turtle using the default excavate command would be fine) and then do the edges with a series of shafts. It only takes about a minute for a turtle digging straight down to hit bedrock (maybe 2 minutes if you start at the top of a mountain?).

Most of what I know of LUA I learned in a few hours watching Direwolf20's CC tutorials and reading http://lua.gts-stolberg.de/en/index.php and giving myself assignments to utilize each new bit of info. After that, I've just learned by seeing something in another turtle program I'd like to try. That's been enough for me to write my own quarry programs (although they're nowhere near as good as what's on the CC forums) and handle various tasks around my base like auto-enchanting.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
You could start off just running "excavate 1" and move the turtle after each shaft. "go forward 1", "turn left" etc. would do, or you could break and replace but remember to label it first.

And, I don't think your tower is wide enough. I'd double it, you'll need the space. Unless that's just the central access shaft that you'll branch the actual rooms off of course.
 

TheCyberTronn

New Member
Jul 29, 2019
57
0
0
You could start off just running "excavate 1" and move the turtle after each shaft. "go forward 1", "turn left" etc. would do, or you could break and replace but remember to label it first.

And, I don't think your tower is wide enough. I'd double it, you'll need the space. Unless that's just the central access shaft that you'll branch the actual rooms off of course.

You don't even have to write the 1 after "go forward". It does it automagically!
 

bunnaryben

New Member
Jul 29, 2019
14
0
0
d'oh, screenshot made me think building above ground and made me forget what I had just read.

Digging vertical pillars is really easy.
Code:
for i = 1, <height> do
    turtle.digDown()
    turtle.down()
end
 
for i = 1, <height> do
    turtle.up
end
Digs straight down then comes back up to where it started.

Digging a circle is actually kinda complicated since your circle design would either have to incorporate the blocks the turtle has to move through outside the desired circle, or the turtle would have to fill in holes behind itself. Filling in would probably mean you'd have to code a way for the turtle to know when it's digging the circle and when it's digging to get to where it needs to be to keep digging the circle. It's certainly possible, but it's probably easier to hollow out the majority of your cylinder with some sort of quarry (a turtle using the default excavate command would be fine) and then do the edges with a series of shafts. It only takes about a minute for a turtle digging straight down to hit bedrock (maybe 2 minutes if you start at the top of a mountain?).

Most of what I know of LUA I learned in a few hours watching Direwolf20's CC tutorials and reading http://lua.gts-stolberg.de/en/index.php and giving myself assignments to utilize each new bit of info. After that, I've just learned by seeing something in another turtle program I'd like to try. That's been enough for me to write my own quarry programs (although they're nowhere near as good as what's on the CC forums) and handle various tasks around my base like auto-enchanting.


Thanks I'll check out those videos. I decided to use the excavate mode, I think it is, to dig the main shaft and then do each block by its self of what's left. Thank you again for your help![DOUBLEPOST=1364343537][/DOUBLEPOST]
And, I don't think your tower is wide enough. I'd double it, you'll need the space. Unless that's just the central access shaft that you'll branch the actual rooms off of course.


It goes from about 135 on the Y, to bedrock. Each level is 4 blocks tall and there's a three block separation between each. So far we haven't had space problems so it's been pretty good.