Sayomie550

Untitled

Jul 18th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1. local tree = 0
  2.  
  3. while turtle.detectDown or not turtle.detectDown do
  4.  
  5.     if redstone.getInput("left", true) then
  6.         tree = tree + 1
  7.            
  8.         print( "Tree Detected Starting Logging Sequence" )
  9.         print( "This is tree number: "..tree )
  10.            
  11.         turtle.turnLeft()
  12.         turtle.dig()
  13.         turtle.forward()
  14.  
  15.         while turtle.detectUp() do
  16.             turtle.digUp()
  17.             turtle.up()
  18.         end
  19.        
  20.         while not turtle.detectUp() and not turtle.detectDown() do
  21.             turtle.down()
  22.         end
  23.        
  24.         turtle.back()
  25.        
  26.         print( "Replanting Sapling" )
  27.         turtle.select(1)
  28.         turtle.place(1)
  29.         turtle.turnRight()
  30.     end
  31.        
  32.     if redstone.getInput("right", true) then
  33.         tree = tree + 1
  34.        
  35.         print( "Tree Detected Starting Logging Sequence" )
  36.         print( "This is tree number: "..tree )
  37.        
  38.         turtle.turnRight()
  39.         turtle.dig()
  40.         turtle.forward()
  41.  
  42.         while turtle.detectUp() do
  43.             turtle.digUp()
  44.             turtle.up()
  45.         end
  46.        
  47.         while not turtle.detectUp() and not turtle.detectDown() do
  48.             turtle.down()
  49.         end
  50.        
  51.         turtle.back()
  52.        
  53.         print( "Replanting Sapling" )
  54.         turtle.select(1)
  55.         turtle.place(1)
  56.         turtle.turnLeft()
  57.     end
  58.    
  59.     if turtle.detect() and not turtle.detectDown() then
  60.        
  61.         if turtle.getItemSpace(2) == 0 then
  62.        
  63.             while turtle.detectUp() do
  64.                 turtle.digUp()
  65.             end
  66.             turtle.up()
  67.            
  68.             while turtle.detect() do
  69.                 turtle.dig()
  70.             end
  71.             turtle.forward()
  72.            
  73.             while turtle.detect() do
  74.                 turtle.dig()
  75.             end
  76.             turtle.forward()
  77.        
  78.             turtle.select(2)
  79.             turtle.drop()
  80.            
  81.             if turtle.getItemSpace(3) < 64 then
  82.                 turtle.select(3)
  83.                 turtle.drop()
  84.             end
  85.            
  86.             turtle.back()
  87.             turtle.back()
  88.             turtle.down()
  89.         end
  90.        
  91.         turtle.turnRight()
  92.         turtle.turnRight()
  93.     end
  94.    
  95.     if turtle.detect() then
  96.         turtle.turnRight()
  97.     end
  98.  
  99.     if not turtle.detect() then
  100.         turtle.forward()
  101.     end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment