Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pastebin get WWSRZmNu mine
- area = 20
- function moveForward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function moveUp()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- --#### COMPARE UP ####
- function compareUp()
- turtle.select(1)
- turtle.compareUp()
- if turtle.compareUp() == true then
- print("Stone")
- else
- turtle.select(2)
- turtle.compareUp()
- if turtle.compareUp() == true then
- print("Gravel")
- else
- turtle.select(3)
- turtle.compareUp()
- if turtle.compareUp() == true then
- print("Marble")
- else
- turtle.select(4)
- turtle.compareUp()
- if turtle.compareUp() == true then
- print("Dirt")
- else
- turtle.digUp()
- print("Valuable found")
- end
- end
- end
- end
- end
- --#### COMPARE DOWN ####
- function compareDown()
- turtle.select(1)
- turtle.compareDown()
- if turtle.compareDown() == true then
- print("Stone")
- else
- turtle.select(2)
- turtle.compareDown()
- if turtle.compareDown() == true then
- print("Gravel")
- else
- turtle.select(3)
- turtle.compareDown()
- if turtle.compareDown() == true then
- print("Marble")
- else
- turtle.select(4)
- turtle.compareDown()
- if turtle.compareDown() == true then
- print("Dirt")
- else
- turtle.digDown()
- print("Valuable found")
- end
- end
- end
- end
- end
- --#### DROP OFF ####
- function dropOff()
- turtle.dig()
- turtle.select(16)
- turtle.place()
- for i = 5, 15 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(16)
- turtle.dig()
- end
- --#### MINE ROW ####
- function mineRow()
- for i = 1, area do
- moveForward()
- compareUp()
- compareDown()
- end
- dropOff()
- end
- --#### MINE 10x10 ###
- function mineSquare()
- for i = 1, area/2 do
- mineRow()
- turtle.turnRight()
- moveForward()
- turtle.turnRight()
- mineRow()
- turtle.turnLeft()
- moveForward()
- turtle.turnLeft()
- end
- turtle.turnLeft()
- for i = 1, area do
- moveForward()
- end
- turtle.turnRight()
- for i = 1,3 do
- moveUp()
- end
- end
- -- #### MINE SEVERAL ROWS ####
- function mine()
- for i = 1, 7 do
- mineSquare()
- end
- end
- --#### TO BEDROCK ####
- function toBedrock()
- mineStart = yLvl - yStart
- for i = 1, mineStart do
- turtle.digDown()
- turtle.down()
- end
- end
- -- #### RETURN TO SURFACE ####
- function goUp()
- for i = 1, yLvl-(yStart+22) do
- moveUp()
- end
- end
- --#### LOOP ####
- print("What is my Y level?")
- yLvl = io.read()
- print("I will mine a "..area.."x"..area.." area")
- print("what Y level would you like me to start at?")
- yStart = io.read()
- toBedrock()
- mine()
- goUp()
- print("finished")
Advertisement
Add Comment
Please, Sign In to add comment