Sayomie550

Untitled

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