Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local R=0
- print("Turtle starts at Top/Right/Back Corner!")
- print("")
- print("Starting position, UP/DOWN? 0:No , ..,-2,-1,1,2,..")
- local strZ=read()+0
- print("Starting position, Forward? 0:No , 1,2,..")
- local strX=read()+0
- print("Length/Forward? (min. 1)")
- local Len=read()+0
- print("Width? (min. 1)")
- local Wid=read()+0
- print("Height/Depth? (min. 1)")
- local Dep=read()+0
- print("chose: 1 = back to start position")
- print(" 0 = stay in End position")
- local PZ=read()+0
- local PX=0
- local PY=0
- if strZ>0 then
- for a=1, strZ do
- while turtle.detectUp() do
- turtle.digUp()
- end
- turtle.up()
- end
- elseif strZ<0 then
- for a=-1, strZ,-1 do
- while turtle.detectDown() do
- turtle.digDown()
- end
- turtle.down()
- end
- end
- if strX>0 then
- for a=1,strX do
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- end
- end
- for z=1,Dep do
- for y=1,Wid do
- for x=1,Len do
- if x<Len then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- if turtle.getFuelLevel()<10 then
- for a=1,16 do
- turtle.select(a)
- turtle.refuel()
- end
- end
- else
- if PX==0 then
- PX=1
- else
- PX=0
- end
- end
- end
- if y<Wid then
- if R==0 then
- turtle.turnLeft()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turtle.turnLeft()
- R=1
- else
- turtle.turnRight()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turtle.turnRight()
- R=0
- end
- else
- if PY==0 then
- PY=1
- else
- PY=0
- end
- end
- end
- if z<Dep then
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- if PZ==1 then
- for z=2,Dep do
- turtle.up()
- end
- if PX==1 then
- turtle.turnLeft()
- turtle.turnLeft()
- for x=2,Len do
- turtle.forward()
- end
- end
- if PY==1 then
- turtle.turnLeft()
- for y=2,Wid do
- turtle.forward()
- end
- turtle.turnRight()
- end
- for x=1,strX do
- turtle.forward()
- end
- if strZ>0 then
- for z=1,strZ do
- turtle.down()
- end
- elseif strZ<0 then
- for z=-1,strZ,-1 do
- turtle.up()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement