nomnuggetnom

Treetap

Aug 16th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local height = 0
  2.  
  3. function scan()
  4.     for i=1,height do
  5.         turtle.dig()
  6.         turtle.up()
  7.         if i==height then
  8.             turtle.dig()
  9.         end
  10.     end
  11.  
  12.     for i=1,height do
  13.         turtle.down()
  14.     end
  15. end
  16.  
  17. function rotate()
  18.         turtle.turnLeft()
  19.         turtle.forward()
  20.         turtle.turnRight()
  21.         turtle.forward()
  22.         turtle.turnRight()
  23. end
  24.  
  25. function store()
  26.         for i=1,16 do
  27.                 turtle.select(i)
  28.                 turtle.dropDown()
  29.                 turtle.select(1)
  30.         end
  31. end
  32.  
  33. -------------
  34. while true do
  35. -------------
  36.  
  37. print("How tall is your tree?")
  38. heightInput = read()
  39. height = heightInput-1
  40.  
  41. scan()
  42. store()
  43. sleep(5)
  44. rotate()
  45. scan()
  46. sleep(5)
  47. rotate()
  48. scan()
  49. sleep(5)
  50. rotate()
  51. scan()
  52. sleep(5)
  53. rotate()
  54.  
  55. end
Advertisement
Add Comment
Please, Sign In to add comment