Advertisement
Guest User

deepDigger

a guest
Jun 2nd, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1. x = 0
  2.  
  3. function clear()
  4.  while not turtle.back() do
  5.   turtle.turnRight()
  6.   turtle.turnRight()
  7.   sleep(1)
  8.   while turtle.detect() do
  9.    turtle.dig()
  10.   end
  11.   sleep(1)
  12.   turtle.turnRight()
  13.   turtle.turnRight()
  14.  end
  15.  turtle.forward()
  16. end
  17.  
  18. function down()
  19.  while x <= 5 do -- REPLACE D WITH CURRENT Y-5
  20.   turtle.digDown()
  21.   turtle.down()
  22.   x = x+1
  23.  end
  24. end
  25.  
  26. function up()
  27.  for i = 1, x do
  28.   while not turtle.up() do
  29.    turtle.digUp()
  30.   end
  31.  end
  32.  x = 0
  33. end
  34.  
  35. print("This code hasn't been tested over a size of 6x6.")
  36. print("Requires chunk loader in the area.")
  37. print("Put coal in slot 15 and enderchest in slot 16.")
  38. print("Depth D must be edited prior to program use")
  39. print("Hold Ctrl + T to stop program.")
  40. print("At the moment turtle will not return to start location")
  41. term.write("Please enter commander name: ")
  42.  K = read()
  43.  
  44. term.write("How far out?  ")
  45.  o = read()
  46.  
  47. term.write("How far right?  ")
  48.  w = read()
  49.  
  50. term.write("Commencing Operation: deepDigger!!!")
  51.  
  52. for k = 0, w do
  53.  if k >= 1 then do
  54.  for l = 1, o do
  55.   turtle.back()
  56.  end
  57.  turtle.turnRight()
  58.  turtle.dig()
  59.  turtle.forward()
  60.  turtle.turnLeft()
  61.  clear()
  62. end
  63.  for u = 1, o do
  64.   turtle.dig()
  65.  while not turtle.forward() do
  66.   turtle.dig()
  67.   sleep(1)
  68.  end
  69.   turtle.select(15)
  70.   turtle.digDown()
  71.   down()
  72.   up()
  73.   turtle.digUp()
  74.   turtle.dig()
  75.   turtle.select(16)
  76.  while not turtle.placeUp() do
  77.   turtle.digUp()
  78.  end
  79.  for d = 1, 14 do
  80.   turtle.select(d)
  81.   turtle.dropUp()
  82.  end
  83.   turtle.select(16)
  84.   turtle.digUp()
  85.   turtle.select(15)
  86.   turtle.refuel(3)
  87.   sleep(2)
  88.  d = 1
  89. end
  90. end
  91. end
  92.  for J = 1, o do
  93.   turtle.back()
  94.  end
  95.  
  96.  turtle.turnRight()
  97.  
  98.  for j = 0, w do
  99.   turtle.back()
  100.  end
  101.  
  102.  turtle.turnLeft()
  103.  
  104. print("All done")
  105. print("Please command me")
  106. print(K)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement