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

I'm Just Talkin' About Shaft! (He Can Dig It)

Started by GopherAtl, 24 July 2013 - 04:42 PM
GopherAtl #1
Posted 24 July 2013 - 06:42 PM
This is a simple little program I just threw together, it works similar to the built-in "go" command, but instead of just going where you tell it, it digs a shaft along the way.

Uses only a limited set of the go commands - fd, lt, rt, and bk. Placed at eye-level, it will dig forward and down.


but! it adds some -flags you can pass as args, which change how it digs.

-tall
makes it dig up as well as down each step. This is a bit slower because of necessary gravel- and sand-related sleep()

-cross
makes it dig not only up, but left and right. Slower still!

-torch=<slot>
specify a slot number and it will place one down every 12th step as it moves, starting with the 6th step. This is close enough that the interior of the tunnel should be lit enough to prevent spawning!

and that's… well… pretty much that. Screenshot of him digging a shaft:



pastebin get 68Ryq8iv shaft
H4X0RZ #2
Posted 24 July 2013 - 07:17 PM
Interesting!
GopherAtl #3
Posted 24 July 2013 - 08:09 PM
not really. but useful!
cheetah #4
Posted 25 July 2013 - 01:55 AM
not really. but useful!

Ya rly!
Can i use this code to make a railway builder?
GopherAtl #5
Posted 25 July 2013 - 02:17 AM
I suppose you could. You could tweak the code slightly - find torchSpace=11 and change it to torchSpace=1, and use the -torch=<slot> arg but give it track instead of torches, and it would even lay track as it went, though you'd have to go back and add lighting and booster rails and polish up the tunnels by hand.