Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. function check()
  2. if turtle.getFuelLevel() < 100 then
  3. turtle.turnLeft()
  4. turtle.select(16)
  5. turtle.suck(64)
  6. turtle.refuel(64)
  7. turtle.turnRight()
  8. end
  9.  
  10. if turtle.getItemCount(15) < 1 then
  11. turtle.turnLeft()
  12. turtle.turnLeft()
  13. turtle.select(15)
  14. turtle.suck()
  15. turtle.turnRight()
  16. turtle.turnRight()
  17. end
  18.  
  19. if turtle.getItemCount(1) > 0 then
  20. turtle.turnRight()
  21. turtle.select(1)
  22. turtle.drop()
  23. turtle.select(2)
  24. turtle.drop()
  25. turtle.turnLeft()
  26. end
  27. end
  28.  
  29. function cut()
  30. check()
  31.  
  32. turtle.select(1)
  33. turtle.dig()
  34. turtle.forward()
  35.  
  36. while turtle.detectUp() do
  37. turtle.suck()
  38. turtle.digUp()
  39. turtle.up()
  40. end
  41.  
  42. while not turtle.detectDown() do
  43. turtle.suck()
  44. turtle.down()
  45. end
  46.  
  47. turtle.back()
  48. turtle.select(15)
  49. turtle.place()
  50. end
  51.  
  52. while turtle.detect() do
  53. local success, t = turtle.inspect()
  54.  
  55. if success then
  56. if t.name == "MineFactoryReloaded:rubberwood.log" then
  57. cut()
  58. end
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement