Advertisement
tobiasfr82

treechopper

Jun 25th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. -- Treechopper alpha 0.01
  2. -- Intended use is the static chopping of Oak Trees or other trees.
  3.  
  4. -- Refuel
  5.         turtle.select(1)
  6.  
  7.     turtle.refuel(10)
  8.  
  9.         turtle.select(2)
  10.  
  11. -- Move to tree
  12.  
  13.     turtle.forward()
  14.     turtle.forward()
  15.  
  16. -- Have tree grown
  17.  
  18.     local success, t = turtle.inspect()
  19.        
  20.         if success then
  21.        
  22.             blockName = t.name
  23.             print( "The block infront of your turtle is named " .. t.name .. " and has a metadata value of " .. t.metadata )
  24.  
  25.        
  26.         else
  27.         print( "There isn't a block below your turtle" )
  28.     end
  29.  
  30.     if string.match(blockName, "log") then
  31.                 print ("Wood detected.")
  32.  
  33.                 turtle.dig()               
  34.                 turtle.forward()
  35.  
  36.                 turtle.digUp()
  37.                 turtle.up()
  38.                 turtle.digUp()
  39.                 turtle.up()
  40.                 turtle.digUp()
  41.                 turtle.up()
  42.                 turtle.digUp()
  43.                 turtle.up()
  44.  
  45.  
  46.                 turtle.down()
  47.                 turtle.down()
  48.                 turtle.down()
  49.                 turtle.down()
  50.  
  51.                    
  52.                     turtle.select(16)
  53.  
  54.                 turtle.suck()
  55.                 turtle.back()
  56.                 turtle.suck()
  57.                
  58.                 turtle.place()
  59.                
  60.                     turtle.select(2)
  61.  
  62.     end
  63.  
  64. -- If so then chop else go back
  65.  
  66. -- Move to chest
  67.  
  68.     turtle.back()
  69.     turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement