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

Self-Sustaining Branch-Mining Turtle Program (GPS/NO GPS) (Works after re-log)

Started by deery50, 10 March 2014 - 11:23 PM
deery50 #1
Posted 11 March 2014 - 12:23 AM
Self-Sustaining Branch-Mining Turtle Program

Welcome to my Branch-Mining program. This program will mine a strait tunnel in front of the turtle and mine any resources on the walls, floor, and ceiling. To make it a "branch mine" you would require at least 2 turtles running this program 2 blocks apart (this will get all of the resources in that area). So what exactly do I mean by self-sustaining? Well the Turtle will return to the surface whenever the inventory is full or if it needs fuel and it will deposit it's items and get fuel from the fuel chest. Then it will go back and continue it's tunnel. But the biggest difference between this program and others is that, if you log out and log in, it will start up, know where it is, and continue it's mine after it stops for fuel and to drop off it's resources.

NEW FEATURES (as of 6/8/2015):
- Now supports no GPS mode! Just set useGPS to false and then fill out StartX, StartY, and StartZ, and the facing direction, the program will now constantly keep track of it's current location.
- The Turtle will now mine into walls that contain ores and such instead of just mining what it sees by default (this means it will attempt to mine the whole vein). It will still know where it is after reboot!

Quick Example:
[media]http://youtu.be/Eqou3l03oTE[/media]

Full Setup Tutorial and code walkthrough:
Spoiler[media]http://www.youtube.com/watch?v=_ko_utMn9G0[/media]

New (not in video) for no GPS mode fill this information located at the top of the script:
– Set this to false if you don't have a working GPS system
local UseGPS = false
–ALL THIS MUST BE FILLED IN IF YOU DON"T USE GPS
local StartX = 0
local StartY = 0
local StartZ = 0
– EX: "SOUTH", "NORTH", "EAST", "WEST"
local ForwardFacingDirection = ""
–END NO GPS FILL INFORMATION

Finally the pastebin: http://pastebin.com/NzKDScRh

Setup Guide (Text)
Spoiler
  1. If you wish to set up a GPS system and use GPS mode I would recommend this program if you are having trouble setting it up: http://www.computerc...-gps-deploy-10/
  2. Place a Mining Turtle (with wireless connectivity) at a place where you are ok for it to mine down.
  3. At this location place 1 chest in front of it (this will be the ore dump chest), and 1 chest to the LEFT of it (this will be the re-fueling chest).
  4. Place any of the fuel (has to be the same fuel) you are going to be using in the LEFT chest.
  5. Open the turtle and type in:
    pastebin get NzKDScRh BranchMine
    Then type in:
    edit BranchMine
  6. Change the top 3 variables to your liking (the comments will inform you on what they mean/do).
  7. Pay attention to the IgnoreSlots variable and set it to the number of blocks you don't want the turtle to mine (EX: Stone, Dirt, etc) and put these in the first slots.
  8. If you want No GPS mode then change UseGPS to false and fill in the proceeding variables (read the comments)
  9. (REMEMBER) the item values for the ignoreslots have to be the same. So for example if you put cobblestone in, the turtle will still mine the smooth stone
  10. Now press ctrl then Enter to save the program
  11. Now type in:
    edit Startup
  12. put these lines in the Startup program accordingly:

sleep(5)
print("Resuming Mine program")
shell.run("BranchMine")

Congratulations! You have successfully setup the Self-Sustaining Branch-Mining program. If you have any questions first watch the setup video also linked further up in this post and if you still have questions feel free to comment.
Edited on 08 June 2015 - 08:11 PM
Blueblood #2
Posted 12 March 2014 - 11:54 AM
When the turtle has a full inventory or runs out of a fuel it gives me the error:
BranchMine:299: attempt to compare __l t on nill and number
deery50 #3
Posted 13 March 2014 - 10:41 AM
That error means it was unable to retrieve a gps position for any reason. Check to see if your gps system has halted for some reason and remember to sleep the command line on the startup script before running the program

When the turtle has a full inventory or runs out of a fuel it gives me the error:
BranchMine:299: attempt to compare __l t on nill and number

It was unable to retrieve gps position from within the mine. Make sure your gps system is setup and within range. As this is a fairly new program I am still working on gps off mode. This mode would require saving the coordinates of the turtle off of the first coordinates it wqs given. Of course their are many innacuricies with this.
deery50 #4
Posted 08 June 2015 - 10:11 PM
NEW FEATURES (as of 6/8/2015):
- Now supports no GPS mode! Just set useGPS to false and then fill out StartX, StartY, and StartZ, and the facing direction, the program will now constantly keep track of it's current location.
- The Turtle will now mine into walls that contain ores and such instead of just mining what it sees by default (this means it will attempt to mine the whole vein). It will still know where it is after reboot!
SwagMasterIV #5
Posted 22 June 2015 - 02:55 AM
I never heard of a GPS System before. How do I set one up and what does it do? I looked it up on the wiki but it didn't seem to help me with this.
Edited on 22 June 2015 - 01:01 AM
Lupus590 #6
Posted 22 June 2015 - 10:43 AM
https://www.youtube.com/watch?v=0_5W0gcZD8I
Scrogth #7
Posted 24 June 2015 - 01:03 AM
Hi I got following message: "You had GPS enabled but there is not a modem on this turtle". The turtle is a wireless turtle. The modem is visible at his right side. I used neonerz's program to set up my gps-system.