Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local minFuel = 875
- local i=0
- local function ClearTerminal()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function AssureInv()
- if turtle.getItemCount(15)>0 then
- turtle.digDown()
- turtle.select(16)
- turtle.placeDown()
- for i=1,15,1 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(16)
- turtle.digDown()
- --turtle.select(1)
- end
- end
- local function DigForward(count)
- for i=1,count,1 do
- AssureInv()
- turtle.dig()
- while turtle.forward()==false do
- turtle.dig()
- turtle.attack()
- sleep(0.05)
- end
- turtle.digUp()
- turtle.digDown()
- end
- end
- local function RightFace()
- turtle.turnRight()
- DigForward(1)
- turtle.turnRight()
- end
- local function LeftFace()
- turtle.turnLeft()
- DigForward(1)
- turtle.turnLeft()
- end
- local function GoUp()
- for i=1,3,1 do
- while turtle.up()==false do
- turtle.attackUp()
- turtle.digUp()
- end
- end
- turtle.digUp()
- end
- local function DigTierOne()
- --Dig down to starting position
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.up()
- DigForward(6)
- RightFace()
- DigForward(12)
- turtle.back()
- LeftFace()
- DigForward(10)
- RightFace()
- DigForward(10)
- turtle.back()
- LeftFace()
- DigForward(8)
- turtle.back()
- RightFace()
- DigForward(6)
- turtle.back()
- turtle.back()
- LeftFace()
- DigForward(2)
- turtle.back()
- turtle.turnLeft()
- DigForward(6)
- turtle.turnLeft()
- DigForward(6)
- RightFace()
- DigForward(12)
- turtle.back()
- LeftFace()
- DigForward(10)
- RightFace()
- DigForward(10)
- turtle.back()
- LeftFace()
- DigForward(8)
- turtle.back()
- RightFace()
- DigForward(6)
- turtle.back()
- turtle.back()
- LeftFace()
- DigForward(2)
- RightFace()
- GoUp()
- end
- local function DigTierTwo()
- --Row 1
- DigForward(4)
- turtle.turnRight()
- turtle.turnRight()
- DigForward(7)
- --Row 2
- LeftFace()
- DigForward(9)
- --Row 3
- RightFace()
- DigForward(11)
- --Row 4
- LeftFace()
- DigForward(13)
- --Row 5
- RightFace()
- DigForward(14)
- --Row 6
- LeftFace()
- DigForward(14)
- --Row 7
- RightFace()
- DigForward(14)
- --Row 8
- LeftFace()
- DigForward(14)
- --Row 9
- RightFace()
- DigForward(14)
- --Row 10
- LeftFace()
- DigForward(14)
- --Row 11
- RightFace()
- DigForward(14)
- turtle.back()
- --Row 12
- LeftFace()
- DigForward(12)
- turtle.back()
- --Row 13
- RightFace()
- DigForward(10)
- turtle.back()
- --Row 14
- LeftFace()
- DigForward(8)
- turtle.back()
- --Row 15
- RightFace()
- DigForward(6)
- end
- local function DigTierThree()
- turtle.turnLeft()
- turtle.turnLeft()
- DigForward(8)
- LeftFace()
- DigForward(11)
- RightFace()
- DigForward(12)
- LeftFace()
- DigForward(13)
- RightFace()
- DigForward(14)
- LeftFace()
- DigForward(14)
- RightFace()
- DigForward(14)
- --Get the sole abyssal block projecting in the -x direction
- turtle.turnLeft()
- DigForward(1)
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.turnLeft()
- DigForward(14)
- RightFace()
- DigForward(14)
- LeftFace()
- DigForward(14)
- RightFace()
- DigForward(14)
- turtle.back()
- LeftFace()
- DigForward(12)
- RightFace()
- DigForward(12)
- turtle.back()
- LeftFace()
- DigForward(10)
- turtle.back()
- turtle.back()
- RightFace()
- DigForward(3)
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- DigForward(3)
- end
- local function DigTierFour()
- turtle.turnLeft()
- turtle.turnLeft()
- DigForward(7)
- LeftFace()
- DigForward(9)
- RightFace()
- DigForward(11)
- LeftFace()
- DigForward(13)
- RightFace()
- DigForward(14)
- LeftFace()
- DigForward(14)
- RightFace()
- DigForward(14)
- LeftFace()
- DigForward(14)
- RightFace()
- DigForward(14)
- LeftFace()
- DigForward(14)
- RightFace()
- DigForward(14)
- turtle.back()
- LeftFace()
- DigForward(12)
- turtle.back()
- RightFace()
- DigForward(10)
- turtle.back()
- LeftFace()
- DigForward(8)
- turtle.back()
- RightFace()
- DigForward(6)
- end
- local function MoveToTierFive()
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- turtle.back()
- turtle.turnLeft()
- GoUp()
- end
- local function DigTierFive()
- DigForward(4)
- LeftFace()
- DigForward(7)
- RightFace()
- DigForward(9)
- LeftFace()
- DigForward(10)
- RightFace()
- DigForward(11)
- LeftFace()
- DigForward(12)
- RightFace()
- DigForward(12)
- LeftFace()
- DigForward(12)
- turtle.back()
- RightFace()
- DigForward(10)
- LeftFace()
- DigForward(10)
- turtle.back()
- RightFace()
- DigForward(8)
- turtle.back()
- LeftFace()
- DigForward(6)
- turtle.back()
- turtle.back()
- RightFace()
- DigForward(2)
- end
- local function FinalDump()
- turtle.select(16)
- turtle.placeDown()
- for i=1,15,1 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(16)
- turtle.digDown()
- end
- --=========== Main Program ===========
- --Make sure we have enough fuel to begin
- ClearTerminal()
- if turtle.getFuelLevel()<minFuel then
- print("WARNING: Insufficient fuel; please add fuel to slot 1")
- end
- turtle.select(1)
- while turtle.getFuelLevel()<minFuel do
- if turtle.refuel()==true then
- print("Fuel level now " .. turtle.getFuelLevel() .. " of " .. minFuel .. " needed")
- end
- sleep(0.1)
- end
- --Make sure we have an ender chest to
- --route material back to our base
- if turtle.getItemCount(16)~=1 then
- print("Place an ender chest in slot 16")
- end
- while turtle.getItemCount(16)~=1 do
- sleep(0.1)
- end
- --Proceed with the geode mining
- ClearTerminal()
- print("Digging geode, check back in 22 minutes")
- print("Initial fuel level is " .. turtle.getFuelLevel())
- DigTierOne()
- DigTierTwo()
- GoUp()
- DigTierThree()
- GoUp()
- DigTierFour()
- MoveToTierFive()
- DigTierFive()
- FinalDump()
- print("Final fuel level is " .. turtle.getFuelLevel())
Advertisement
Add Comment
Please, Sign In to add comment