TheKojent

TreeTapper

Mar 11th, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. function tap()
  2.   turtle.dig()
  3.   for i = 1,7 do
  4.     turtle.up()
  5.     turtle.dig()
  6.   end
  7.   for i = 1,7 do
  8.     turtle.down()
  9.   end
  10. end
  11.  
  12. function edge()
  13.   for i = 1,3 do
  14.     turtle.forward()
  15.     turtle.turnRight()
  16.     tap()
  17.     turtle.turnLeft()
  18.     turtle.forward()
  19.   end
  20. end
  21.  
  22. function forward(x)
  23.   for l = 1,x do
  24.     turtle.forward()
  25.   end
  26. end
  27.  
  28. function corridor()
  29.   for j = 1,3 do
  30.     turtle.forward()
  31.     turtle.turnRight()
  32.     tap()
  33.     turtle.turnLeft()
  34.     turtle.turnLeft()
  35.     tap()
  36.     turtle.turnRight()
  37.     turtle.forward()
  38.   end
  39. end
  40.  
  41. local tArgs = { ... }
  42. loop = tonumber(tArgs[1])
  43. for count = 1,loop do
  44.   turtle.select(1)
  45.   for k = 1,4 do
  46.     edge()
  47.     turtle.turnRight()
  48.   end
  49.   forward(2)
  50.   turtle.turnRight()
  51.   corridor()
  52.   turtle.turnLeft()
  53.   forward(2)
  54.   turtle.turnLeft()
  55.   corridor()
  56.   turtle.turnRight()
  57.   forward(2)
  58.   turtle.turnRight()
  59.   forward(2)
  60.   turtle.turnRight()
  61.   corridor()
  62.   turtle.turnLeft()
  63.   forward(2)
  64.   turtle.turnLeft()
  65.   corridor()
  66.   turtle.turnLeft()
  67.   forward(4)
  68.   turtle.turnLeft()
  69.   forward(6)
  70.   for i = 1,16 do --Clears inventory
  71.     turtle.select(i)
  72.     turtle.drop()
  73.   end
  74.   turtle.turnRight()
  75.   turtle.turnRight()
  76. end
Advertisement
Add Comment
Please, Sign In to add comment