Sayomie550

Untitled

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