Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local length = tonumber(args[1])
- local depth = tonumber(args[2])
- local height = tonumber(args[3])
- length = length or 3
- height = height or 3
- depth = depth or 3
- local need = length * height * depth
- local x = length
- local y = height - 1
- local z = depth
- local check = 1
- local bottom = 1
- local top = 0
- local left = 1
- local right = 0
- local l = 1
- local r = 0
- local q = x
- function fuel(amount)
- if turtle.getFuelLevel() < 5 then
- turtle.select(16)
- turtle.refuel(amount)
- turtle.select(1)
- end
- end
- function chest()
- if turtle.getItemCount(14) >= 1 then
- turtle.turnRight(2)
- while turtle.detect() do
- turtle.dig()
- sleep(0.5)
- end
- turtle.select(15)
- turtle.place()
- for m=1,14 do
- turtle.select(m)
- turtle.drop()
- end
- turtle.select(1)
- turtle.turnLeft(2)
- end
- end
- function move()
- if right == 0 and left == 0 then
- while turtle.detect() do
- turtle.dig()
- sleep(0.75)
- end
- turtle.forward()
- end
- if right == 1 then
- turtle.turnLeft()
- while turtle.detect() do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- turtle.turnLeft()
- right = 0
- end
- if left == 1 then
- turtle.turnRight()
- while turtle.detect() do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- turtle.turnRight()
- left = 0
- end
- end
- function up()
- if bottom == 1 then
- move()
- for a = 1, y do
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- turtle.up()
- fuel(1)
- chest()
- end
- end
- end
- function down()
- if top == 1 then
- move()
- for b = 1, y do
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.25)
- end
- turtle.down()
- fuel(1)
- chest()
- end
- end
- end
- function value()
- if bottom == 1 then
- bottom = 0
- top = 1
- else
- bottom = 1
- top = 0
- end
- end
- function switch()
- if l == 1 then
- left = 0
- right = 1
- l = 0
- r = 1
- else
- left = 1
- right = 0
- l = 1
- r = 1
- end
- end
- function back()
- if top == 1 then
- for c = 1, y do
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.25)
- end
- turtle.down()
- end
- end
- end
- if turtle.getFuelLevel() < need and turtle.getItemCount(16) == 0 then
- print("Please add fuel in slot 16")
- check = 0
- end
- if need > 500 and turtle.getItemCount(15) == 0 then
- print("Please put chests in slot 15")
- check = 0
- end
- if check == 1 then
- print("Digging away")
- turtle.turnLeft()
- for j = 1, z do
- for i = 1, x do
- up()
- down()
- if (i % 5) == 0 and (j % 5) == 0 then
- end
- value()
- if i == q then
- switch()
- end
- end
- end
- back()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement