Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t=turtle
- function detect()
- while t.detect() do
- t.dig()
- end
- while t.detectUp() do
- t.digUp()
- end
- end
- function dig()
- t.digUp()
- t.dig()
- t.digDown()
- detect()
- chest()
- t.forward()
- end
- function digger()
- if p==1 then t.turnRight() else t.turnLeft() end
- x=x-1
- while x>0 do
- x=x-1
- dig()
- chest()
- end
- y=y-1
- x=ox
- t.digUp()
- t.digDown()
- if y>0 then
- if p==1 then t.turnLeft() else t.turnRight() end
- dig()
- else t.down()
- t.digDown()
- t.down()
- t.digDown()
- t.down()
- y=oy
- z=z-3
- if p==0 then t.turnLeft() p=1 else t.turnRight() p=0 end
- end
- if p==1 then p=0 else p=1 end
- fuel()
- end
- function drop()
- t.select(16)
- t.place()
- for i=1,14 do
- t.select(i)
- t.drop()
- end
- t.select(1)
- fuel()
- end
- function chest()
- if t.getItemCount(14)>0 then
- if p==1 then
- t.turnRight()
- drop()
- t.turnLeft()
- else
- t.turnLeft()
- drop()
- t.turnRight()
- end
- end
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function fuel()
- if t.getFuelLevel() < x*y then print("Refuel") t.select(15)
- while t.getFuelLevel() < x*y do
- t.refuel(1)
- end
- end
- t.select(1)
- end
- clear()
- print("Width")
- ox=read()
- ox=tonumber(ox)
- print("Length")
- oy=read()
- oy=tonumber(oy)
- print("Height ( multiple 3 )")
- z=read()
- z=tonumber(z)
- x=ox
- y=oy
- fuel()
- p=1
- while z>0 do
- digger()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement