Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local length = 0;
- if #tArgs ~= 1 then
- print("Strip Mining...")
- length = 100
- else
- length = tonumber( tArgs[1] )
- if length < 1 then
- print( "Length must be positive" )
- return
- else
- print( "Strip Mining..." )
- end
- end
- local depth = 0
- local torch = 0
- local distance = 0
- function sortInv()
- for i = 1, 16 do
- if turtle.getItemSpace(i) > 0 then
- turtle.select(i)
- for j = i, 16 do
- if turtle.compareTo(j) then
- turtle.transferTo(i, turtle.getItemCount(j))
- end
- end
- end
- end
- end
- local function aboutFace()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- for n=1,length do
- turtle.select(2)
- turtle.placeDown()
- turtle.select(1)
- turtle.turnLeft()
- turtle.dig()
- aboutFace()
- turtle.dig()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- turtle.up()
- turtle.dig()
- aboutFace()
- turtle.dig()
- turtle.digUp()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- turtle.up()
- turtle.dig()
- aboutFace()
- turtle.dig()
- turtle.down()
- turtle.down()
- turtle.turnLeft()
- turtle.dig()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- distance = distance + 1
- if torch == 8 then
- aboutFace()
- turtle.place()
- aboutFace()
- torch = 0
- sortInv()
- else
- torch = torch + 1
- end
- for m=3,16 do
- turtle.select(m)
- if turtle.getItemDetail() ~= nil then
- if turtle.getItemDetail().name == "minecraft:cobblestone" or turtle.getItemDetail().name == "minecraft:dirt" then
- turtle.drop()
- end
- end
- end
- if turtle.getItemCount(1) == 0 then break end
- end
- aboutFace()
- turtle.digUp()
- turtle.up()
- for n=1,distance do
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- else
- turtle.forward()
- end
- end
- aboutFace()
- print("Finished Strip Mining")
- print(distance)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement