Advertisement
Guest User

MineObs

a guest
Nov 25th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.93 KB | None | 0 0
  1. print("program to mine obsidian!")
  2. print("..")
  3. print("dirt in slot 1")
  4. print("bucket of water in slot 2")
  5. print("bucket of lava in slot 3")
  6. print("redstone in slot 4,5,6")
  7.  
  8.  
  9. print("press ENTER to start program")
  10.  
  11. -- sit in a loop untill the ENTER key is pressed
  12. while true do
  13.   press, key = os.pullEvent()
  14.     if press == "key" and key == 28 then
  15.       break
  16.     end
  17. end
  18.  
  19.  
  20. -- loop the code 8 times
  21. for i = 1, 8 do
  22. print("i is "..tostring(i))  
  23.  
  24.  
  25. -- gets into the starting position
  26. turtle.forward()
  27. turtle.down()
  28.  
  29. -- selects the dirt
  30. turtle.select(1)
  31.  
  32. --places the dirt (7 blocks)
  33. x = 0
  34.   while x < 7 do
  35.     turtle.placeDown()
  36.     turtle.forward()
  37.     x = x + 1
  38.   end
  39.  
  40. -- gets into position to drop the water
  41. turtle.up()
  42. y = 0
  43.   while y < 3 do
  44.     turtle.back()
  45.     y = y + 1
  46.   end
  47. turtle.select(2)
  48. turtle.placeDown()
  49.  
  50. -- wait while the water spreads
  51. os.sleep( 2 )
  52.  
  53. -- move back to the start of the line to start minig the dirt
  54. y = 0
  55.   while y < 3 do
  56.     turtle.back()
  57.     y = y + 1
  58.   end
  59.  
  60. -- mine the dirt
  61. turtle.down()
  62. turtle.digDown()
  63. turtle.down()
  64. --turtle.digDown()
  65. y = 0
  66.  
  67.   while y < 6 do
  68.     turtle.dig()
  69.     turtle.forward()
  70.     y = y + 1
  71.   end
  72.  
  73. -- gets into position to drop the redstone
  74. turtle.up()
  75. turtle.up()
  76. turtle.turnLeft()
  77. turtle.forward()
  78. turtle.forward()
  79. turtle.turnRight()
  80. turtle.down()
  81.  
  82. -- places the redstone
  83. turtle.select(4)
  84. y = 0
  85.     while y < 7 do
  86.     turtle.placeDown()
  87.     turtle.back()
  88.     y = y + 1
  89.   end
  90. turtle.up()
  91.  
  92. -- gets into position to place the lava
  93. y = 0
  94. while y < 2 do
  95.   turtle.forward()
  96.   y = y + 1
  97. end
  98.  
  99. -- drop the lava
  100. turtle.select(3)
  101. turtle.place()
  102. turtle.up()
  103.  
  104. -- waits for the lava to spread
  105. os.sleep(15)
  106.  
  107. -- pick the lava back up
  108. turtle.down()
  109. turtle.place()
  110. os.sleep(10)
  111.  
  112. -- move back to the start of the line
  113. y = 0
  114. while y < 2 do
  115.   turtle.back()
  116.   y = y + 1
  117. end  
  118.  
  119.  
  120.  
  121. -- mine the obsidian
  122. turtle.down()
  123. turtle.digDown()
  124. turtle.down()
  125. y = 0
  126. while y < 6 do
  127.   turtle.dig()
  128.   turtle.forward()
  129.   y = y + 1
  130. end
  131.  
  132.   turtle.up()
  133.   turtle.up()
  134.    
  135.  
  136.  
  137.  
  138.  
  139. -- pick the water back up
  140. turtle.turnRight()
  141. turtle.forward()
  142. turtle.forward()
  143. turtle.turnLeft()
  144. turtle.back()
  145. turtle.back()
  146. turtle.back()
  147. turtle.select(2)
  148. turtle.placeDown()
  149. turtle.back()
  150. turtle.back()
  151. turtle.back()
  152. turtle.back()
  153.  
  154.  
  155. -- drop the obsidian in the chest
  156. turtle.up()
  157. turtle.turnRight()
  158. turtle.forward()
  159. turtle.forward()
  160. turtle.select(8)
  161. turtle.dropDown()
  162.  
  163. -- go back to the starting position
  164. turtle.turnLeft()
  165. turtle.turnLeft()
  166. turtle.forward()
  167. turtle.forward()
  168. turtle.down()
  169. turtle.turnRight()
  170.  
  171.  
  172. -- put the obsidian in the chest
  173.  
  174. --turtle.down()
  175.  
  176.  
  177.  
  178.  
  179. -- puts the dirt that we have picked up back into slot 1
  180. turtle.select(7)
  181. turtle.transferTo(1)
  182.  
  183.  
  184. --print(" ")
  185. print("finished!!!!!!")
  186.  
  187.  
  188.  
  189. -- go back to starting position
  190.  
  191. y = 0
  192. while y < 3 do
  193. --  turtle.back()
  194. --  y = y + 1
  195. end
  196.  
  197.  
  198.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement