Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. print("welcome")
  2. print("place stopper block in slot 1")
  3. print("place stopper block2 in slot 2")
  4. function fuel()
  5. if turtle.getFuelLevel() < 100 then
  6. turtle.select(9)
  7. turtle.suckUp()
  8. turtle.refuel()
  9. empty = turtle.getItemCount(9)
  10. if empty > 0 then
  11.  
  12. turtle.dropUp(empty)
  13. end
  14. end
  15. end
  16.  
  17. function stopper()
  18. turtle.select(3)
  19. while turtle.compare() == false do
  20. for b=0, 9 do
  21. turtle.select(1)
  22. if turtle.compare() then
  23. turtle.turnLeft()
  24. end
  25. turtle.select(2)
  26. if turtle.compare() then
  27. turtle.turnRight()
  28. end
  29. turtle.dig()
  30. turtle.forward()
  31. end
  32. end
  33. end
  34. function drop()
  35. for i=3, 16 do
  36. local count = turtle.getItemCount(i)
  37. if count > 0 then
  38. turtle.select(i)
  39. turtle.dropDown()
  40. end
  41. i = i + 1
  42. end
  43. print("inventory empty of shit =]")
  44. end
  45.  
  46.  
  47. for a=0, 9 do
  48. print("detecting sugar cane")
  49. if turtle.detect() then
  50. fuel()
  51. stopper()
  52. drop()
  53. else
  54. print("no sugar cane detected")
  55. end
  56. os.sleep(5)
  57.  
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement