Advertisement
Timcard30

[CC] Single Tree+Bone Meal chopper

Jul 15th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. -- Tim_ofzo
  2. -- pastebin get
  3. -- Left  Chest = Logs
  4. -- Right Chest = Saplings
  5.  
  6. -- Settings:
  7. local minFuelLevel = 200
  8.  
  9. -- Functions:
  10. function suckSaplings()
  11.   turtle.select(1)
  12.   turtle.turnRight()
  13.   turtle.suck(64)
  14.   turtle.turnLeft()
  15. end
  16.  
  17. function dropLogs()
  18.   turtle.turnLeft()
  19.   for i=3,15 do
  20.     turtle.dropDown()
  21.   end
  22.   turtle.turnRight()
  23. end
  24.  
  25. function refuel()
  26.   if turtle.getFuelLevel() < minFuelLevel then
  27.     turtle.turnLeft()
  28.     turtle.select(16)
  29.     turtle.suck(64)
  30.     turtle.turnRight()
  31.     turtle.refuel(63)
  32.   end
  33. end
  34.  
  35. function place()
  36.  turtle.select(1)
  37.  turtle.place()
  38. end
  39.  
  40. function grow()
  41.  turtle.select(16)
  42.  turtle.place()
  43. end
  44.  
  45. function chop()
  46.   turtle.select(2)
  47.   if turtle.compare() == true then
  48.     turtle.dig()
  49.     turtle.up()
  50.   end
  51. end  
  52.  
  53. while true do
  54.  refuel()
  55.  sleep(1)
  56.  suckSaplings()
  57.  sleep(1)
  58.  place()
  59.  sleep(1)
  60.  grow()
  61.  sleep(1)
  62.  chop()
  63.  sleep(1)
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement