daily pastebin goal
41%
SHARE
TWEET

huber

a guest Jan 29th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkFuel()
  2.   if turtle.getFuelLevel() < 10 then
  3.     turtle.select(1)
  4.     turtle.refuel(1)
  5.   end
  6.   turtle.select(2)
  7. end
  8.  
  9. function digMove()
  10.   checkFuel()
  11.   turtle.dig()
  12.   turtle.forward()
  13. end
  14.  
  15. function column()
  16.   height = 0
  17.   while turtle.digUp() do
  18.     checkFuel()
  19.     turtle.dig()
  20.     turtle.up()
  21.     height = height + 1
  22.   end
  23.   return height
  24. end
  25.  
  26. function columnDown(height)
  27.   for i=1,height do
  28.     checkFuel()
  29.     turtle.dig()
  30.     turtle.digDown()
  31.     turtle.down()
  32.   end
  33.   turtle.dig()
  34. end
  35.  
  36. function chest()
  37.   turtle.back()
  38.   turtle.dig()
  39.   turtle.back()
  40.   turtle.dig()
  41.   turtle.back()
  42.   turtle.dig()
  43.   turtle.turnLeft()
  44.   for i=3,16 do
  45.     turtle.select(i)
  46.     turtle.drop()
  47.   end
  48.   turtle.up()
  49.   turtle.select(1)
  50.   if turtle.getItemCount(1) == 0 then
  51.     turtle.suck()
  52.   end
  53.   turtle.up()
  54.   turtle.select(2)
  55.   if turtle.getItemCount(2) < 4 then
  56.     turtle.suck()
  57.   end
  58.   turtle.down()
  59.   turtle.down()
  60.   turtle.turnRight()
  61. end
  62.  
  63. function replant()
  64.   turtle.select(2)
  65.   turtle.forward()
  66.   turtle.forward()
  67.   turtle.forward()
  68.   turtle.forward()
  69.   turtle.place()
  70.   turtle.turnRight()
  71.   turtle.forward()
  72.   turtle.turnLeft()
  73.   turtle.place()
  74.   turtle.turnRight()
  75.   turtle.back()
  76.   turtle.place()
  77.   turtle.turnLeft()
  78.   turtle.back()
  79.   turtle.place()
  80. end
  81.  
  82. function chop()
  83.   digMove()
  84.   distance = column()
  85.   turtle.turnRight()
  86.   digMove()
  87.   turtle.turnLeft()
  88.   columnDown(distance)
  89.   turtle.turnLeft()
  90.   turtle.forward()
  91.   turtle.turnRight()
  92.   turtle.back()
  93.   chest()
  94.   replant()
  95. end
  96.  
  97. while true do
  98.   turtle.select(2)
  99.   if not turtle.compare() then
  100.      chop()
  101.   end
  102. end
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top