Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Author: Streqicity
- --Version: 0.0.8
- --Purpose: Branch Miner
- --Date: 1/24/2015
- args = {...}
- intNumberBranches = args[1]
- intBranchLength = args[2]
- function mainTunnelForward()
- checkInv()
- turtle.dig()
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.digUp()
- turtle.digDown()
- end
- function mainTunnelTotal()
- mainTunnelForward()
- mainTunnelForward()
- mainTunnelForward()
- end
- function sideTunnelForward(Length,Direction)
- if Direction == "Left" then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- for k = 1,Length do
- checkInv()
- turtle.dig()
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.digUp()
- turtle.digDown()
- if k % 7==0 then
- placeTorch()
- end
- end
- UTurn()
- for k = 1,Length do
- while not turtle.forward() do
- turtle.dig()
- end
- end
- if Direction == "Left" then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- function checkFuel()
- if turtle.getFuelLevel()<80 then
- print("Need MOAR fuel please deposit in first slot")
- turtle.select(1)
- while not turtle.refuel() do
- sleep(1)
- end
- else
- return
- end
- end
- function checkInv()
- for k = 6,16 do
- if turtle.getItemCount(k) == 0 then
- return
- end
- end
- turtle.select(4)
- turtle.placeUp()
- for k = 6,16 do
- turtle.select(k)
- while not turtle.dropUp() do
- print("Chest full please check")
- sleep(1)
- end
- end
- turtle.select(4)
- turtle.digUp()
- end
- function UTurn()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function placeTorch()
- turtle.select(2)
- turtle.down()
- if turtle.detectDown() then
- turtle.up()
- turtle.placeDown()
- else
- turtle.select(3)
- turtle.placeDown()
- turtle.up()
- turtle.select(2)
- turtle.placeDown()
- end
- end
- for k = 1,intNumberBranches do
- checkFuel()
- mainTunnelTotal()
- placeTorch()
- checkFuel()
- sideTunnelForward(intBranchLength,"Left")
- checkFuel()
- sideTunnelForward(intBranchLength,"Right")
- end
Advertisement
Add Comment
Please, Sign In to add comment