ComputerCraft Forums

ComputerCraft => Programs => Turtle Programs => Topic started by: justinjah91 on Aug 23, 2022, 04:04 PM

Title: Safebranch - A mining program
Post by: justinjah91 on Aug 23, 2022, 04:04 PM
This program is designed to create a SAFE branch mine with 3x3 hallways, with multiple turtles working in tandem. The turtles will seal off any holes in the walls and will light the mine as they dig it, ensuring that no mobs get into your mine! They will also seal off any lava or water so your mine does not flood [See note 1]. Each turtle is responsible for either a branch or the main trunk of the mine. It is recommended to use at least 3 turtles (one for the main trunk and one for a branch on each side of the trunk), but fewer can be used with some manual repositioning. How it works:


The code: https://pastebin.com/XYMvEYDB

          * For MC versions before 1.18, tunnels should be of length 10n + 4 (where n is an integer 1, 2, ...)
          * For MC versions 1.18+, tunnels should be of length 24n + 11


For specifics of the setup, go to https://imgur.com/a/GJglvsW

Calling sequence: Safebranch <type> <length> <direction> <# of turtles> <min light lvl>
          * Should be at least 1, but can be as many as you like
          * For MC versions lower than 1.18, this should be greater than or equal to 8
          * For 1.18+, it should be greater than or equal to 1.

[Note 1] More recent versions of CC (for minecraft 1.13+) include the ability to waterlog turtles. While this may not cause an issue for small pockets of water, it WILL cause issues for larger pockets or aquifers. There is no way to combat this unless the devs add an option to disable waterlogging. For this reason, I recommend digging a small 1x1x1 hole in the floor at the start of each tunnel to stop any floods that do occur. I know it is annoying to have water sources in the tunnel (it drives me crazy), but in these versions of CC the turtles are incapable of directly removing water. All workarounds that I have considered involve silly things, like giving the turtles sponges and/or buckets, thus taking up valuable inventory space and reducing their effectiveness as mining turtles. For the time being, I suggest using some water proof light source in slot 3 (like lanterns or glowstone). These sorts of workarounds should NOT be necessary on 1.12 and earlier.

The code: https://pastebin.com/XYMvEYDB