Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startx,starty,startz=gps.locate()
- x,y,z = gps.locate()
- while(y > 12)
- do
- turtle.digDown()
- turtle.down()
- x,y,z = gps.locate()
- end
- mine = true
- while(mine)
- do
- if mine == true
- then
- turn = math.random(1,3)
- rnd = math.random(20,100)
- end
- while(rnd > 0)
- do
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- rnd = rnd - 1
- slot = turtle.getItemCount(16)
- if slot > 0
- then
- rnd = 0
- mine = false
- turn = 0
- end
- end
- if turn == 1
- then
- turtle.turnRight()
- elseif turn > 1
- then
- turtle.turnLeft()
- end
- end
- endx,endy,endz = gps.locate(10)
- end1 = true
- while(end1)
- do
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- x,y,z = gps.locate()
- disendx = startx - endx
- if disendx < 0
- then
- disendx = disendx * -1
- end
- discurx = startx - x
- if discurx < 0
- then
- discurx = discurx * -1
- end
- if disendx > discurx
- then
- end1 = false
- end
- turtle.back()
- end
- end2 = true
- while(end2)
- do
- turtle.dig()
- turtle.forward()
- x,y,z = gps.locate()
- discurx = startx - x
- if discurx < 0
- then
- discurx = discurx * -1
- end
- if discurx == 0
- then
- end2 = false
- end
- end
- end3 = true
- while(end3)
- do
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- x,y,z = gps.locate()
- disendz = startz - endz
- if disendz < 0
- then
- disendz = disendz * -1
- end
- discurz = startz - z
- if discurz < 0
- then
- discurz = discurz * -1
- end
- if disendz > discurz
- then
- end3 = false
- end
- turtle.back()
- end
- end4 = true
- while(end4)
- do
- turtle.dig()
- turtle.forward()
- x,y,z = gps.locate()
- discurz = startz - z
- if discurz < 0
- then
- discurz = discurz * -1
- end
- if discurz == 0
- then
- end4 = false
- end
- end
- end5 = true
- while(end5)
- do
- turtle.digUp()
- turtle.up()
- x,y,z = gps.locate()
- if y == starty
- then
- end5 = false
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
Add Comment
Please, Sign In to add comment