Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables and Functions
- tool = "left"
- weapon = "right"
- function moveForward()
- while not turtle.forward() do
- if not turtle.detect() then
- turtle.attack(weapon)
- else
- turtle.dig(tool)
- end
- end
- end
- function mineOneChunkLayer()
- --Starter Postion Length of 15
- for i=1,14 do
- if turtle.detectDown() then
- turtle.digDown(tool)
- end
- moveForward()
- end
- turtle.digDown(tool)
- turtle.turnRight()
- moveForward()
- turtle.turnRight()
- --Full Chunk Length of 16
- local turnDir = "l"
- for i=1,15 do
- for i=1,15 do
- if turtle.detectDown() then
- turtle.digDown(tool)
- end
- moveForward()
- end
- if i == 15 then
- turtle.turnRight()
- else
- if turnDir == "l" then
- turtle.digDown(tool)
- turtle.turnLeft()
- moveForward()
- turtle.turnLeft()
- turnDir = "r"
- else
- turtle.digDown(tool)
- turtle.turnRight()
- moveForward()
- turtle.turnRight()
- turnDir = "l"
- end
- end
- end
- --Return to item processor and
- --Dump all items
- for i=1,14 do
- moveForward()
- end
- for i=1,16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnRight()
- moveForward()
- turtle.turnLeft()
- moveForward()
- turtle.turnRight()
- turtle.down()
- end
- term.clear()
- term.setCursorPos(1,1)
- write("Turtle Y Position: ")
- turtleY = tonumber(read())
- print(" ")
- write("Target Y Position: ")
- targetY = tonumber(read())
- diffY = turtleY - targetY
- print(" ")
- print("Mining Chunk!")
- for i=1, diffY-1 do
- mineOneChunkLayer()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement