Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DescentMax = 55
- length = 4
- width = 4
- LeftOrRight = 1
- function log(msg)
- file = fs.open("quarry.log", "a")
- file.write(msg)
- file.close()
- end
- function fw(blocks)
- for i=1, blocks do
- if turtle.detect() then
- turtle.dig()
- log("Dig a block while going forward\n")
- end
- turtle.forward()
- end
- print("Gone forward\n")
- end
- function dw(blocks)
- for i=1, blocks do
- if turtle.detectDown() then
- turtle.digDown()
- log("Dig a block while going down\n")
- end
- turtle.down()
- end
- print("Gone down\n")
- end
- function up(blocks)
- for i=1, blocks do
- if turtle.detectUp() then
- turtle.digUp()
- log("Dig a block while going up\n")
- end
- turtle.up()
- end
- print("Gone up\n")
- end
- fw(width)
- for u=0, DescentMax do
- for x=1, length do
- print(LeftOrRight.."\n")
- turn = LeftOrRight%2
- print(turn.."\n")
- if turn == 0 then
- turtle.turnLeft()
- fw(1)
- turtle.turnLeft()
- print("Turn left")
- else
- turtle.turnRight()
- fw(1)
- turtle.turnRight()
- print("Turn right")
- end
- fw(width)
- LeftOrRight = LeftOrRight+1
- end
- dw(1)
- if turn == 1 then
- turtle.turnLeft()
- fw(1)
- turtle.turnRight()
- else
- turtle.turnRight()
- fw(1)
- turtle.turnLeft()
- end
- LeftOrRight = LeftOrRight+1
- for slot=1, 16 do
- turtle.select(slot)
- items = turtle.getItemDetail()
- if items then
- if items.name == "minecraft:dirt" or items.name == "minecraft:sand" then
- turtle.drop()
- end
- if turtle.getItemCount(15) > 1 then
- if items.name == "minecraft:cobblestone" then
- turtle.drop()
- turtle.select(15)
- turtle.transferTo(slot)
- turtle.select(slot)
- end
- end
- end
- end
- turtle.select(1)
- print("Current level :"..u)
- end
- turtle.turnRight()
- turtle.turnRight()
- fw(width)
- up(DescentMax+1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement