Want more features on Pastebin? Sign Up, it's FREE!
Guest

Wood

By: a guest on Dec 16th, 2012  |  syntax: None  |  size: 1.17 KB  |  views: 11,231  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. local function checkFuel()
  2.   if turtle.getFuelLevel() < 20 then
  3.     turtle.select(1)
  4.     turtle.refuel(1)
  5.   end
  6. end
  7.  
  8. local function column()
  9.   while turtle.digUp() do
  10.     turtle.dig()
  11.     checkFuel()
  12.     turtle.up()
  13.   end
  14.   turtle.dig()
  15.  
  16.   checkFuel()
  17.   while turtle.down() do
  18.     checkFuel()
  19.   end
  20. end
  21.  
  22. local function digmove()
  23.   checkFuel()
  24.   turtle.dig()
  25.   turtle.forward()
  26. end
  27.  
  28. local function fell()
  29.   digmove()
  30.   column()
  31.   turtle.turnRight()
  32.   digmove()
  33.   turtle.turnLeft()
  34.   column()
  35. end
  36.  
  37. local function replant()
  38.   turtle.select(15)
  39.   turtle.suck()
  40.   turtle.place()
  41.   turtle.turnLeft()
  42.   turtle.suck()
  43.   turtle.forward()
  44.   turtle.suck()
  45.   turtle.turnRight()
  46.   turtle.suck()
  47.   turtle.place()
  48.   turtle.turnRight()
  49.   turtle.suck()
  50.   turtle.place()
  51.   turtle.turnRight()
  52.   turtle.suck()
  53.   turtle.forward()
  54.   turtle.suck()
  55.   for slot=3,7 do
  56.     turtle.select(slot)
  57.     turtle.drop()
  58.   end
  59.   turtle.turnLeft()
  60.   turtle.turnLeft()
  61.   turtle.select(15)
  62.   turtle.place()
  63.   turtle.select(2)
  64.   while not turtle.compare() do
  65.     turtle.select(16)
  66.     turtle.place()
  67.     turtle.select(2)
  68.   end
  69. end
  70.  
  71. while true do
  72.   fell()
  73.   replant()
  74. end
clone this paste RAW Paste Data