Advertisement
Guest User

chop

a guest
May 20th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. function chopTree()
  2.   turtle.dig()
  3.   turtle.forward()
  4.   turtle.digDown()
  5.   turtle.select(2)
  6.   while turtle.compareUp() do
  7.     turtle.digUp()
  8.     turtle.up()
  9.   end
  10.   while turtle.detectDown() == false do
  11.     turtle.down()
  12.   end
  13. end
  14.  
  15. function clearInv()
  16.   for i = 2, 16 do
  17.     turtle.select(i)
  18.     turtle.dropDown()
  19.   end
  20. end
  21.  
  22. function checkLeft()
  23.   turtle.turnLeft()
  24.   if turtle.detect() then
  25.     chopTree()
  26.     turtle.up()
  27.     turtle.select(1)
  28.     turtle.placeDown()
  29.     turtle.back()
  30.   end
  31.   turtle.turnRight()
  32. end
  33.  
  34. turtle.select(1)
  35. while true do
  36.   turtle.forward()
  37.   turtle.forward()
  38.   turtle.forward()
  39.   checkLeft()
  40.   if turtle.detectDown() then
  41.     if turtle.getFuelLevel() < 100 then
  42.       turtle.select(2)
  43.       turtle.refuel()
  44.     end
  45.     clearInv()
  46.     turtle.select(1)
  47.     turtle.turnRight()
  48.     turtle.forward()
  49.     turtle.turnRight()
  50.     checkLeft()
  51.   end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement