jdanner95

LumberJack v1.0

Oct 25th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. --LumberJack v1.0
  2.  
  3. --while turtle.detect() do
  4.  -- Up()
  5. --end
  6.  
  7. --function cut()
  8.   --for i = 0, 10, 1 do
  9.    -- for j = 1, 4, 1 do
  10.       --turtle.dig()
  11.      -- turtle.turnRight()
  12.     -- end
  13.     -- turtle.digUp()
  14.      --turtle.up()
  15.   -- end
  16. --end
  17.  
  18. function refuel()--to refuel is with coal or other
  19.   if turtle.getFuelLevel() < 10 then
  20.     turtle.select(16)
  21.     turtle.refuel(10)
  22.     turtle.select(1)
  23.   end
  24. end
  25.  
  26. function Plant()--to plant trees in slot 2
  27.   turtle.select(2)
  28.   if turtle.getItemCount(2) > 1 then
  29.     turtle.place()
  30.    end
  31. end
  32.  
  33. refuel() --this loop is to tell him to go up
  34. turtle.dig()
  35. turtle.forward()
  36. turtle.select(1)
  37.  
  38. while turtle.compareUp() do
  39.   refuel()
  40.   turtle.select(1)
  41.   turtle.digUp()
  42.   turtle.up()
  43. end
  44.  
  45. while turtle.detectDown() == false do--this is to tell him to go down
  46.   refuel()
  47.   turtle.down()
  48. end
  49. turtle.back()
  50. Plant()
Add Comment
Please, Sign In to add comment