Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TODOS:
- -- implementation of sand and gravel handling
- -- digging a 3x3 area with a length of n blocks
- print("how far?")
- Length = tonumber(read())
- while turtle.getFuelLevel() < Length * 5 do
- print("not enough fuel")
- sleep(2)
- Fuel()
- end
- -- checking if the turtle has a chest in the last slot
- turtle.select(16)
- while true do
- if turtle.getItemDetail() then
- local item = turtle.getItemDetail()
- while item.name ~= "minecraft:chest" do
- print("vanilla chest needed in last slot!")
- sleep(5)
- end
- break
- else
- print("vanilla chest needed in last slot!")
- sleep(5)
- end
- end
- -- checking if the turtle has enough torches in the second to last slot
- turtle.select(15)
- while true do
- if turtle.getItemDetail() then
- local item = turtle.getItemDetail()
- while item.name ~= "minecraft:torch" do
- print("vanilla torches needed in second to last slot!")
- sleep(5)
- end
- if turtle.getItemCount() then
- local itemCount = turtle.getItemCount()
- local minTorches = Length / distanceTorches
- while itemCount < minTorches do
- print("not enough vanilla torches!")
- sleep(5)
- end
- end
- break
- else
- print("vanilla torches needed in second to last slot!")
- sleep(5)
- end
- end
- -- 3x3 area per block
- for i = 1, Length, 1 do
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- -- place a torch every 3rd block
- if i % distanceTorches == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(15)
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- if Length > i then
- turtle.dig()
- turtle.forward()
- end
- end
- -- chest must be placed in 16th slot
- turtle.select(16)
- turtle.placeDown()
- for i = 1, 16, 1 do
- turtle.select(i)
- turtle.dropDown()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement