Advertisement
LeviathanV

Spruce Tree Killer

Oct 6th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. while true do
  2.    
  3. function chop()
  4.     while turtle.compare(15) do
  5.         turtle.dig()
  6.         turtle.digUp()
  7.         turtle.up()
  8.     end
  9. end
  10.        
  11. function down()
  12.     while not turtle.detect(not turtle.detectDown()) do
  13.         turtle.down()
  14.     end
  15. end
  16.  
  17. function drop()
  18.     for i=1, 4 do
  19.         turtle.select(i)
  20.         turtle.drop()
  21.     end
  22. end
  23.        
  24. function replant()
  25.     if turtle.detect(turtle.compare(16)) then
  26.         turtle.up()
  27.     else
  28.         if not turtle.detect(turtle.detectDown()) then
  29.             turtle.select(16)
  30.             turtle.suckDown()
  31.             turtle.drop(turtle.getItemCount(16) -2)
  32.             turtle.place()
  33.             replant()
  34.         end
  35.     end
  36. end
  37. sleep(5)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement