Advertisement
exploder2013

Tekkit - Miner (Mining Turtle)

Sep 13th, 2012
2,945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.10 KB | None | 0 0
  1. --File Updated at 2012/09/15.
  2. --Update changes - Fixed all bugs, now it's working, I'm still going to make it better.
  3.  
  4. --Mining Turtle Program for Tekkit, save this as startup.
  5. --It will mine till bedrock, and after that go up again, and dump all it's stuff on the place it started.
  6. --It will Mine 15 times one side, after that, he will end up same place where he started.
  7. --The mode "Skip Holes" will work same as Dig, but it will skip all 1 block deep holes.
  8. --Have fun, please don't remove my name from menu, show me some respect atleast :).
  9. --Mining Turtle Program for Tekkit, save this as startup.
  10. --It will mine till bedrock, and after that go up again, and dump all it's stuff on the place it started.
  11. --It will Mine 15 times one side, after that, he will end up same place where he started.
  12. --The mode "Skip Holes" will work same as Dig, but it will skip all 1 block deep holes.
  13.  
  14. -- WARNING --
  15. -- THERE IS BETTER VERSION ON MY PROFILE CALLED Mining Turtle - Self-saving miner, IT STILL HAS SOME BUGS, BUT IT'S BETTER THAN THIS, IT EVEN SAVES POSITION, TRY IT ;).
  16.  
  17.  
  18.  
  19. os.pullEvent = os.pullEventRaw
  20. term.clear()
  21. term.setCursorPos(1,3)
  22. x = 1
  23. y = 0
  24. p = 0
  25. while true do
  26. print("        +-----------------+")
  27. print("        :      Miner      :")
  28. print("        :                 :")
  29. print("        +-----------------+")
  30. print("        :1.Dig.           :")
  31. print("        :2.Skip Holes.    :")
  32. print("        :3.Exit.          :")
  33. print("        +-----------------+")
  34.  
  35.  
  36. term.setCursorPos(1,3)
  37. event, param1, param2 = os.pullEvent()
  38. if event == "char" and param1 == "1" then func() end
  39. if event == "char" and param1 == "2" then bedres() end
  40. if event == "char" and param1 == "3" then iziet() end
  41.  
  42. function bedres()
  43. for i=1,15 do
  44. start()
  45. x = x+1
  46. y = y+1
  47. dig()
  48. upward()
  49. back()
  50. drop()
  51. end
  52. end
  53.  
  54. function func()
  55. for i=1,15 do
  56. start()
  57. x=x+1
  58. y=y+1
  59. mine()
  60. up()
  61. back()
  62. drop()
  63. end
  64. end
  65.  
  66. function dig()
  67. if turtle.detectDown() == false then
  68. turtle.dig()
  69. turtle.forward()
  70. x = x+1
  71. y = y+1
  72. dig()
  73. elseif turtle.detectDown() == true then
  74. below()
  75. end
  76. end
  77.  
  78. function upward()
  79. for i=1,60 do
  80. turtle.up()
  81. end
  82. end
  83.  
  84. function back()
  85. turtle.turnRight()
  86. turtle.turnRight()
  87. for i=1,y do
  88. turtle.dig()
  89. turtle.forward()
  90. end
  91. end
  92.  
  93.  
  94.  
  95. function below()
  96. for i=1,60 do
  97. turtle.digDown()
  98. turtle.down()
  99. for i=1,1 do
  100. down()
  101. end
  102. end
  103. end
  104.  
  105. function drop()
  106. turtle.select(1)
  107. turtle.drop()
  108. turtle.select(2)
  109. turtle.drop()
  110. turtle.select(3)
  111. turtle.drop()
  112. turtle.select(4)
  113. turtle.drop()
  114. turtle.select(5)
  115. turtle.drop()
  116. turtle.select(6)
  117. turtle.drop()
  118. turtle.select(7)
  119. turtle.drop()
  120. turtle.select(8)
  121. turtle.drop()
  122. turtle.select(9)
  123. turtle.turnRight()
  124. turtle.turnRight()
  125. end
  126.  
  127.  
  128. function start()
  129. for i=1,x do
  130. turtle.dig()
  131. turtle.forward()
  132. end
  133. end
  134.  
  135. function mine()
  136. for i=1,60 do
  137. turtle.digDown()
  138. turtle.down()
  139. end
  140. end
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. function down()
  148. if turtle.detectDown() == true then
  149. turtle.digDown()
  150. p = p+1
  151. down()
  152. elseif turtle.digDown() == false then
  153. end
  154. end
  155.  
  156. function up()
  157. for i=1,60 do
  158. turtle.up()
  159. end
  160. end
  161.  
  162.  
  163. function iziet()
  164. term.clear()
  165. term.setCursorPos(1,1)
  166. error()
  167. end
  168. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement