Advertisement
xbsktball10x

till

Feb 19th, 2014
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. rednet.open("left")
  2. function farm()
  3. even = false
  4. x=1
  5. y=0
  6. n=0
  7. for k = 1,52 do
  8. for i = 1,60 do
  9. if turtle.getItemCount(x) == 0 then
  10. repeat turtle.select(x+1)
  11. x = x + 1
  12. if x == 15 then
  13. x = 1
  14. y = y+1
  15. end
  16. if y == 2 then
  17. outOfSeeds(n,i)
  18. os.reboot()
  19. end
  20. until turtle.getItemCount(x) > 0
  21. end
  22. turtle.dig()
  23. turtle.place()
  24. turtle.back()
  25. end
  26.  
  27. if even== false then
  28. turtle.turnRight()
  29. turtle.back()
  30. turtle.turnRight()
  31. even = true
  32. n = n+1
  33. else if even == true then
  34. turtle.turnLeft()
  35. turtle.back()
  36. turtle.turnLeft()
  37. even = false
  38. n = n+1
  39. end
  40. end
  41. end
  42. end
  43. function goHome()
  44. turtle.turnLeft()
  45. for i= 1,51 do
  46. turtle.back()
  47. if i ==49 then
  48. turtle.up()
  49. turtle.turnRight()
  50. turtle.back()
  51. turtle.turnLeft()
  52. end
  53. if i == 51 then
  54. turtle.down()
  55. turtle.turnLeft()
  56. turtle.back()
  57. turtle.turnRight()
  58. end
  59. end
  60. turtle.turnRight()
  61. turtle.back()
  62. turtle.turnRight()
  63. end
  64.  
  65. function refill()
  66. for y = 2,16 do
  67. turtle.select(1)
  68. if turtle.compareUp() == true do
  69. turtle.select(y)
  70. turtle.suckUp()
  71. end
  72. end
  73.  
  74. function outOfSeeds(n,i)
  75. for x = i,60 do
  76. turtle.back()
  77. end
  78. turtle.turnRight()
  79. for z = n,52 do
  80. turtle.back()
  81. if z ==49 then
  82. turtle.up()
  83. turtle.turnRight()
  84. turtle.back()
  85. turtle.turnLeft()
  86. end
  87. if z == 51 then
  88. turtle.down()
  89. turtle.turnLeft()
  90. turtle.back()
  91. turtle.turnRight()
  92. end
  93. end
  94.  
  95. senderId, msg = rednet.receive()
  96.  
  97. if msg == "yes" then
  98. for y =2,16 do
  99. turtle.select(y)
  100. turtle.suckUp()
  101. end
  102. turtle.select(1)
  103. turtle.turnRight()
  104. turtle.back()
  105. turtle.turnRight()
  106. turtle.back()
  107. turtle.turnLeft()
  108. farm()
  109. goHome()
  110. end
  111.  
  112. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement