Advertisement
Timcard30

[CC] Wood Chopper

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