Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function placeTorch()
- local item14 = turtle.getItemDetail(14)
- local item15 = turtle.getItemDetail(15)
- turtle.up()
- turtle.dig()
- turtle.down()
- if (item14) and (item14.name == "minecraft:torch") then
- turtle.select(14)
- turtle.placeUp()
- elseif (item15) and (item15.name == "minecraft:torch") then
- turtle.select(15)
- turtle.placeUp()
- end
- end
- function excavate()
- turtle.dig()
- os.sleep()
- check = 1
- while check == 1 do
- local success, block = turtle.inspect()
- if block.name == "minecraft:gravel" then
- turtle.dig()
- os.sleep(0.5)
- else
- check=0
- end
- end
- turtle.forward()
- turtle.select(13)
- turtle.placeDown()
- turtle.digUp()
- end
- function digReturn()
- local torch = 0
- for i=1,len do
- excavate()
- torch = torch + 1
- if torch >= 10 then
- torch = 0
- placeTorch()
- end
- end
- placeTorch()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,len do
- turtle.forward()
- check = 1
- while check == 1 do
- local success, block = turtle.inspect()
- if block.name == "minecraft:gravel" then
- turtle.dig()
- os.sleep(0.5)
- else
- check = 0
- end
- end
- end
- end
- local arg = {...}
- num = tonumber(arg[1])
- len = tonumber(arg[2])
- turtle.turnLeft()
- for a=1,num do
- digReturn()
- turtle.digDown()
- turtle.down()
- turtle.select(13)
- turtle.placeDown()
- turtle.up()
- turtle.select(16)
- turtle.placeDown()
- for i = 1,12 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- digReturn()
- for i = 1,12 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.turnRight()
- excavate()
- excavate()
- placeTorch()
- excavate()
- turtle.turnLeft()
- end
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement