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

Yet another branch mine program (but this one is awesome)

Started by angellus, 10 March 2014 - 10:01 PM
angellus #1
Posted 10 March 2014 - 11:01 PM
So, I have kind of worked on and off with designing a branch mine program that I liked. The program follows the branch mining layout I generally follow and it is highly configurable.

am-cc:branch.lua version 3.7 for CC1.6
Features:
  • Configurable (number of branches, distance between branches, torches, etc.)
  • Supports color/non-color screens
  • Supports wireless progress updates (transmit update status so another computer display the status)
  • Wireless progress updates can be started after turtle starts
  • Receivers that get progress updates can retransmit the data so you can get better range
  • Mines branch out AND the ores
  • Automated updates
Planned Features:
  • save/resume feature
  • get turtle to play better with liquids
This is an "early" version of my overall OS. Currently this is the only completed program in it. The OS has this program, some shared code and some quickly put together code for two other programs. Tell me what you think, let me know if you have any problems, and enjoy!

N.B. Script was written for CC1.6. I am not longer "supporting" 1.58, so there is no promise it will work for it (sorry).

Read the comments in the script for more details and let me know if you have any questions/problems.

To install:

pastebin get 5W7MiD3d install
install

To update:
By default the script will check for updates everytime you reboot. To force an update, just type in

update

Screenshots: 01 02 03 04 05 06

Changelog (see git commits for more details):
(version numbers adjusted to reflex previous development on this before this version of my branch mining script)
3.7:
  • built program into am-cc OS (public release of automated updates)
3.6:
  • split program into three files (receiver, turtle and shared)
  • multitasking support (will automatically open in new tab)
3.5:
  • bug fixes
  • automated updates (kind of, not quite finished)
3.4:
  • bug fixes
  • turtle will now mine all ores connected to one visible (whole vein)
3.3:
  • bug fixes
  • added logging support
  • improved torch wall placement (block torch is placed on)
  • added retransmitting feature
3.1-3.2:
  • greatly improved torch placement
  • force_dig to make blocks get removed that turtle is not going to move to
  • support to allow receiver to be connected after the turtle starts
3.0.1-3.0.5:
  • bug fixes
3.0.0:
  • initial (re)write and release
Edited on 05 April 2014 - 09:12 PM
iM_KanadiaN #2
Posted 18 March 2014 - 04:36 PM
I would use this code… but its not in pastebin.
kittykiller #3
Posted 18 March 2014 - 08:00 PM
When the turtle gets full it continues to mine and the stuff it can't hold just falls on the ground.
Also could enderchests support be added?

Here's a patebin http://pastebin.com/jd9KkVNn (I'll remove it if the author wants to)
angellus #4
Posted 19 March 2014 - 09:30 PM
I would use this code… but its not in pastebin.

Not to sound like an ass, but it is really that hard to create your own pastebin? Or install something to pull github scritps? If it is really that big of a problem, I can create a pastebin, but if I forget to update the pastebin when I push new code to github, it will not be up to date.

When the turtle gets full it continues to mine and the stuff it can't hold just falls on the ground.
Also could enderchests support be added?

Here's a patebin http://pastebin.com/jd9KkVNn (I'll remove it if the author wants to)

First: I developed this in vanilla Minecraft+ComputerCraft (a lot less ores). During my testing, the turtles inventory never filled up that fast xD (sorry). I am only emptying the inventory after each 1/2 branch and not checking during the mining to help speed up the process. I can certainly add support for it though. I have hit a roadblock on how I designed the positioning. It makes saving/resuming unreliable.

Second, currently the turtle drops off to multiple chests. I plan to add support to allow the user to have the turtle to drop off to only a single chest to prevent the need for so many chests, but that requires the chest to be continuously emptied. I want to get save/resume working before I do this. You can always make the branches shorter to stop this from happening for now.

Third, I have no problem with you putting up a pastebin. Just keep in mind, that pastebin is NOT always up to date. My link I provided is always upto date. Whenever I push an update to github from my local computer, it is there. I would highly recommend getting a utility that lets you pull scripts from github (there are plenty of them out there). I am actually probably going to work on partitioning this script into multiple files so I extract the functionality out for other programs. When I do this, I will make the auto update script so this will no longer be a problem. I can just put up a single pastebin that would point to the installer.

Anyways, thanks for the feedback!
Edited on 19 March 2014 - 08:33 PM
Amdusias #5
Posted 28 March 2014 - 01:50 PM
Hey there.
First of nice program you wrote there.
But I can't use it, I get the following message when starting the program: "branch:1220: attempt to call nil".
And if I try to enter: ".branch.settings" i get this error: "bios:339: [string" .branch.settings"]:1: unexpected symbol"
Would be great if you could help me out. :)/>


Edit: I am playing SMP with CC 1.5I
I am dumb and a newbie, forgive me. :D/> I fixed it now.

But still I have some problems.
I placed everything like it was shown in the pictures. The turtle grabbs the torches, chest and fuel if needed. After that it diggs a 2x3x2 in the direction is was placed. And then it suddenly goes left and either diggs up to no end or down to bedrock.
Seems to be pretty random.
I am on SMP with CC 1.58
Edited on 28 March 2014 - 04:43 PM
angellus #6
Posted 28 March 2014 - 09:20 PM
And then it suddenly goes left and either diggs up to no end or down to bedrock.

Gotta read the on screen instructions. Sounds like you are not giving it a stone and dirt block. ;)/>

Since in vanilla computer craft there is no way to identify the ID of the block the turtle is checking, the only way you can do it is by checking scanning the block and comparing it to one in the inventory. So, at the very start of the program, it will ask you to put in cobblestone and other "do not mine blocks." So, if you are doing a game with just ComputerCraft install, you would want to put a stack of cobblestone in slot 3. Then in slots 4, 5, and 6, put 1 stone, 1 dirt and 1 gravel. This basically tells the turtle to never mine cobblestone, dirt, gravel or stone. The "cobblestone" doubles as a throw away block the turtle can use to place down to make sure torch placement will work and to check for liquids. If you are mining in the nether, you would put a stack of Netherrack in slot 3 and then in slots 4, 5, and 6 put 1 soul sand, 1 gravel and 1 nether brick (this program is not designed to mine nether fortresses, you would actually get a nasty Java error if you tried to let it).
Edited on 28 March 2014 - 08:21 PM
MinestoPix #7
Posted 29 March 2014 - 06:43 PM
hey!

Just wanted to say this one really is awesome :)/> … I hope you continue to work on it.

suggestion - support for pocket computers and multiple turtles would be great later down the line ….

EDIT: can you please tell me what the elseif on line 1338 does? thanks
Edited on 29 March 2014 - 10:12 PM
angellus #8
Posted 02 April 2014 - 02:13 PM
suggestion - support for pocket computers and multiple turtles would be great later down the line ….

It already does ;)/> Just use "bg branch" and open it in a new tab. The current version I am working on and will be releasing soon already has that functionality built in support to open the program in a new tab if the computer supports it.

EDIT: can you please tell me what the elseif on line 1338 does? thanks

Absolutely nothing. haha. That is WIP code from the save/resume feature. I am having trouble reliably getting the turtles current position after resuming, so I have not finished that feature yet, but I have thought of a way to finish it finally, hopefully I will do that soon. Also, I will be putting out automatic updates once I figure out how to get around the caching.
angellus #9
Posted 06 April 2014 - 02:42 AM
Bump for 3.7. Automated updater.