SHARE
TWEET

Untitled

agentsix1 Jun 17th, 2019 1,281 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fuelCheck()
  2.     local fuelLevel = turtle.getFuelLevel()
  3.     if fuelLevel < 100 then
  4.         turtle.select(1)
  5.         turtle.refuel(2)
  6.         print("Refueled.")
  7.     end
  8. end
  9.  
  10. function isLog()
  11.     local success, data = turtle.inspect()
  12.     if data.name == "minecraft:log" then
  13.         return true
  14.     else
  15.         return false
  16.     end
  17. end
  18.  
  19. function isSap()
  20.     local success, data = turtle.inspect()
  21.     if data.name == "minecraft:sapling" then
  22.         return true
  23.     else
  24.         return false
  25.     end
  26. end
  27.    
  28.  function plantTree()
  29.     turtle.turnLeft()
  30.     turtle.select(3)
  31.     turtle.place()
  32.     turtle.turnRight()
  33.     turtle.select(1)
  34. end
  35.  
  36.  function clean()
  37.     turtle.suckUp()
  38.     turtle.suck()
  39.     turtle.turnLeft()
  40.     turtle.suck()
  41.     turtle.turnLeft()
  42.     turtle.suck()
  43.     turtle.turnLeft()
  44.     turtle.suck()
  45.     turtle.turnLeft()
  46.     turtle.suck()
  47. end
  48.  
  49. function mF()
  50.     clean()
  51.     turtle.forward()
  52. end
  53.  
  54. function mB()
  55.     clean()
  56.     turtle.turnLeft()
  57.     turtle.turnLeft()
  58.     clean()
  59.     turtle.forward()
  60.     clean()
  61.     turtle.turnLeft()
  62.     turtle.turnLeft()
  63. end
  64.  
  65. function chop()
  66.     turtle.turnLeft()
  67.     if isLog() then
  68.         turtle.dig()
  69.         turtle.select(3)
  70.         turtle.place()
  71.     else
  72.         if isSap() then
  73.         else
  74.             turtle.select(3)
  75.             turtle.place()
  76.         end
  77.     end
  78.     clean()
  79.     turtle.turnRight()
  80.     clean()
  81. end
  82.  
  83. function check()
  84.     for i = 1, 5 do
  85.         fuelCheck()
  86.         for i = 1, 10 do
  87.             mF()
  88.         end
  89.         turtle.turnRight()
  90.         mF()
  91.         turtle.turnRight()
  92.        
  93.         for i = 1, 5 do
  94.             chop()
  95.             mF()
  96.             mF()
  97.         end
  98.         mF()
  99.         turtle.turnLeft()
  100.         mF()
  101.         mF()
  102.         turtle.turnLeft()
  103.         mF()
  104.     end
  105. end
  106.  
  107. local chopping = true
  108. while chopping do
  109.     check()
  110. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top