Advertisement
Chronno

Computercraft Turtle Tree Tap

Mar 28th, 2013
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. -- Turtle Tree Taping program
  2. -- for use in a tap turtle on a wall of IC2's rubber trees.
  3. -- By Chronno S. Trigger  Http://www.youtube.com/chronnotrigg
  4. -- ------------------------------------------------------------
  5. -- Use: tap x z
  6. -- x = number of blocks over
  7. -- z = number of blocks up
  8. -- Known issues:
  9. -- Since it's impossible to get the turtle to detect if a rubber tree block is ready
  10. -- if you use the program too soon after the last run, you will lose your tap points.
  11.  
  12. local size = {...}
  13.  
  14. function tapUp()
  15.     turtle.dig()
  16.     for i=2,size[2] do
  17.         turtle.up()
  18.         turtle.dig()
  19.     end
  20.     for i=2,size[2] do
  21.         turtle.down()
  22.     end
  23. end
  24.  
  25. function moveRight()
  26.     turtle.turnRight()
  27.     turtle.forward()
  28.     turtle.dturnLeft()
  29. end
  30.  
  31. function comeBack()
  32.     turtle.turnLeft()
  33.     for i=2,size[1] do
  34.         turtle.forward()
  35.     end
  36.     turtle.turnRight()
  37. end
  38.  
  39. tapUp()
  40. for i=2,size[1] do
  41.     moveRight()
  42.     tapUp()
  43. end
  44. comeBack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement