Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local digDepth = 32
- local digWidth = 7
- local torchSpacing = 4
- local currentDepth = torchSpacing - 1
- local digHeight = 12
- local chestSlot = 14
- local torchSlot = 15
- local fuelSlot = 16
- function checkFuel()
- if turtle.getFuelLevel() < 120 then
- turtle.select(fuelSlot)
- turtle.refuel(2)
- turtle.select(1)
- end
- end
- function checkInv()
- if turtle.getItemCount(11) > 0 then
- goAround()
- turtle.select(chestSlot)
- while turtle.place() == false do
- turtle.dig()
- turtle.attack()
- end
- for i = 1, 13 do
- turtle.select(i)
- turtle.drop()
- end
- goAround()
- turtle.select(1)
- end
- end
- function placeTorch()
- turtle.select(torchSlot)
- goAround()
- turtle.place()
- goAround()
- turtle.select(1)
- end
- function goForward(times)
- for i = 1, times do
- while turtle.forward() == false do
- turtle.attack()
- turtle.dig()
- end
- if i == 4 and currentDepth == torchSpacing then
- placeTorch()
- currentDepth = 0
- end
- end
- end
- function goAround()
- for i = 1, 2 do
- turtle.turnLeft()
- end
- end
- function goUp()
- while turtle.up() == false do
- turtle.attackUp()
- turtle.digUp()
- end
- end
- function goDown(times)
- for i = 1, times do
- while turtle.down() == false do
- turtle.attackDown()
- turtle.digDown()
- end
- end
- end
- function digMine()
- local currentHeight = 1
- goForward(1)
- currentDepth = currentDepth + 1
- turtle.turnLeft()
- for i = 1, digHeight do
- goForward(digWidth -1)
- goAround()
- if currentHeight ~= digHeight then
- goUp()
- currentHeight = currentHeight + 1
- end
- end
- goDown(currentHeight -1)
- turtle.turnRight()
- end
- function turtleStart()
- for i = 1, digDepth do
- checkFuel()
- checkInv()
- digMine()
- end
- end
- turtleStart()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement