Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Digging Program by M3veronMast3r")
- print("ONLY type Numbers or the Program returns Error")
- write("lenght: ")
- x=tonumber(io.read())
- write("width: ")
- z=tonumber(io.read())
- write("depth: ")
- y=tonumber(io.read())
- function forward()
- while not turtle.forward() do
- turtle.dig()
- sleep(1)
- end
- end
- function down()
- while not turtle.down() do
- sleep(1)
- end
- end
- x1=0
- z1=0
- t=1
- t1=1
- while y > -1 do
- while z > 0 do
- while x > 0 do
- shell.run("clear")
- print("x: "..x)
- print("y: "..y)
- print("z: "..z)
- x=x-1
- x1=x1+1
- if x > 0 then
- turtle.dig()
- forward()
- end
- end
- while x1 > 0 do
- x=x+1
- x1=x1-1
- end
- z=z-1
- z1=z1+1
- if z > 0 then
- if t > 0 then
- turtle.turnRight()
- turtle.dig()
- forward()
- turtle.turnRight()
- t=0
- elseif t < 1 then
- turtle.turnLeft()
- turtle.dig()
- forward()
- turtle.turnLeft()
- t=1
- end
- elseif z < 1 then
- if y > 0 then
- if t < 1 then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.digDown()
- down()
- t=0
- elseif t > 0 then
- turtle.turnRight()
- turtle.turnRight()
- turtle.digDown()
- down()
- t=1
- end
- end
- end
- end
- while z1 > 0 do
- z=z+1
- z1=z1-1
- end
- y=y-1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement