Advertisement
MadScience2728

Slave

Jan 4th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. -- Number of neighbouring turtles
  2. numberNeighbours = 2
  3.  
  4. -- Open up modem to receive wireless broadcasts
  5. rednet.open("right")
  6.  
  7. -- Wait until neighbouring turtles are ready
  8. function waitForNeighbours(localRowsProgressed)
  9. local message
  10.  
  11. rednet.broadcast("ROW<" .. tostring(localRowsProgressed) .. ">")
  12.  
  13. repeat
  14. message = select(2, rednet.receive())
  15. until message == "You are authorised to proceed"
  16. end
  17.  
  18. bool=true
  19.  
  20. while bool==true do
  21. if rs.getInput("back", true) then
  22. print ("Waiting")
  23. sleep (1)
  24. else
  25. print ("Let's Roll!")
  26. bool=false
  27. end
  28. end
  29.  
  30. X=3
  31.  
  32. print ("Startup Functions Activating")
  33. print ("Going to lowest point")
  34.  
  35. turtle.select(3)
  36. turtle.back()
  37.  
  38. for a = 1, X do
  39. turtle.digDown()
  40. turtle.attackDown()
  41. turtle.attackDown()
  42. turtle.attackDown()
  43. turtle.attackDown()
  44. turtle.attackDown()
  45. turtle.attackDown()
  46. turtle.attackDown()
  47. turtle.attackDown()
  48. turtle.attackDown()
  49. turtle.attackDown()
  50. turtle.attackDown()
  51. turtle.attackDown()
  52. turtle.attackDown()
  53. turtle.attackDown()
  54. turtle.attackDown()
  55. turtle.attackDown()
  56. turtle.attackDown()
  57. turtle.attackDown()
  58. turtle.attackDown()
  59. turtle.attackDown()
  60. turtle.down()
  61. end
  62.  
  63. for b = 1, X do
  64. turtle.digUp()
  65. while not turtle.up() do
  66. turtle.attackUp()
  67. end
  68. end
  69.  
  70. print ("Calibrated level for a flat bedrock world.")
  71. print ("---------------------------")
  72. print ("Starting World Eating Scripts!")
  73. print ("---------------------------")
  74.  
  75. turtle.dig()
  76.  
  77. while not turtle.forward() do
  78. turtle.attack()
  79. end
  80.  
  81. while true do
  82.  
  83. for i = 1, 2 do
  84.  
  85. for c = 1, X do
  86. turtle.dig()
  87. turtle.digDown()
  88. while not turtle.down() do
  89. turtle.attackDown()
  90. end
  91. end
  92.  
  93. for d = 1, X do
  94. turtle.dig()
  95. turtle.digUp()
  96. while not turtle.up() do
  97. turtle.attackUp()
  98. end
  99. end
  100.  
  101. for r = 1, 2 do
  102. turtle.dig()
  103. while not turtle.forward() do
  104. turtle.attack()
  105. end
  106.  
  107. end
  108.  
  109. Fuel = turtle.getFuelLevel()
  110.  
  111. print ("Fuel level is: "..Fuel)
  112.  
  113. if Fuel >= 8192 then
  114.  
  115. print ("Fuel level is above minimum safe limit.")
  116. print ("Refueling anyway")
  117.  
  118. turtle.select(1)
  119.  
  120. for slot = 3, 16 do
  121. result = turtle.compareTo(slot)
  122. if result == true then
  123. turtle.select(slot)
  124. turtle.refuel()
  125. turtle.select(1)
  126. print ("Refueled on slot "..slot)
  127. else
  128. end
  129. end
  130.  
  131. else
  132.  
  133. print ("Fuel is below safe limit! Not collecting enough coal!")
  134.  
  135. turtle.select(1)
  136.  
  137. for slot = 3, 16 do
  138. result = turtle.compareTo(slot)
  139. if result == true then
  140. turtle.select(slot)
  141. turtle.refuel()
  142. turtle.select(1)
  143. print ("Refueled on slot "..slot)
  144. else
  145. end
  146. end
  147. end
  148.  
  149. turtle.select(2)
  150. print ("Dropping off items")
  151.  
  152. turtle.dig()
  153.  
  154. while not turtle.place() do
  155. turtle.attack()
  156. end
  157.  
  158. for dropslot = 3, 16 do
  159. turtle.select(dropslot)
  160. turtle.drop()
  161. end
  162.  
  163. waitForNeighbours()
  164.  
  165. turtle.select(2)
  166.  
  167. turtle.dig()
  168.  
  169. turtle.select(3)
  170.  
  171. end
  172. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement