Advertisement
Zekrommaster110

[COMPUTERCRAFT] Mining Programm V1.3.1

Jul 27th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.33 KB | None | 0 0
  1. ent = 0
  2.  
  3. function clear()
  4.     shell.run("clear")
  5. end
  6.  
  7. function s1()
  8.     while turtle.detect() == true do
  9.         turtle.dig()
  10.         os.sleep(0.6)
  11.     end
  12.     turtle.forward()
  13.     test()
  14.     while turtle.detectUp() == true do
  15.         turtle.digUp()
  16.         os.sleep(0.6)
  17.         os.sleep(0.6)
  18.     end
  19. end
  20.  
  21. function test()
  22.     if turtle.detectDown()==false then
  23.         turtle.select(2)
  24.         turtle.placeDown()
  25.         print("false")
  26.     end
  27. end
  28.  
  29. function drop()
  30.     turtle.select(3)
  31.     turtle.drop(64)
  32.     turtle.select(4)
  33.     turtle.drop(64)
  34.     turtle.select(5)
  35.     turtle.drop(64)
  36.     turtle.select(6)
  37.     turtle.drop(64)
  38.     turtle.select(7)
  39.     turtle.drop(64)
  40.     turtle.select(8)
  41.     turtle.drop(64)
  42.     turtle.select(9)
  43.     turtle.drop(64)
  44.     turtle.select(10)
  45.     turtle.drop(64)
  46.     turtle.select(11)
  47.     turtle.drop(64)
  48.     turtle.select(12)
  49.     turtle.drop(64)
  50.     turtle.select(13)
  51.     turtle.drop(64)
  52.     turtle.select(14)
  53.     turtle.drop(64)
  54.     turtle.select(15)
  55.     turtle.drop(64)
  56.     turtle.select(16)
  57.     turtle.drop(64)
  58. end
  59.  
  60. ---------------------------------------------------
  61. -- START
  62. clear()
  63. print("\n  <-[MINING PROGRAM V1.3.1]->")
  64. print("  (C) Zekrommaster110 2015\n")
  65. sleep(1.5)
  66.  
  67. clear()
  68. write("\n Bitte anzahl der Gaenge eingeben: ")
  69. local gaenge = read()
  70.  
  71. clear()
  72. write("\nDieser Vorgang wird c.a. ")
  73. write(gaenge*0.65)
  74. write(" Minuten in anspruch nehmen.\n\n")
  75. write("\nIn Slot 1 bitte ")
  76. write(gaenge)
  77. write(" Fackeln legen.\n\n")
  78. local nullinput = read()
  79.  
  80. nfuel = gaenge*30
  81. if nfuel > turtle.getFuelLevel() then
  82.     print("Es ist nicht genuegend Fuel eingefuellt!")
  83.     write("Benoetigt werden noch: ")
  84.     write(nfuel-turtle.getFuelLevel())
  85.     write(" Fuel. \n")
  86.     print("Das sind: ")
  87.     write("- ")
  88.     write(nfuel/80)
  89.     write(" Kohle")
  90.     write("\n\n- ")
  91.     write(nfuel/15)
  92.     write(" Wood\n\n")
  93.     print("Druecke Enter zum befuellen.")
  94.     local nullinput = read()
  95.     shell.run("refuel all")
  96. end
  97.  
  98. clear()
  99. print("Bitte legen sie nun noch 2 Truhen in Slot 3.")
  100. print("\nZum starten bitte nocheinmal Enter druecken!\n")
  101. local nullinput = read()
  102.  
  103.  
  104. -- MINING PROGRAMM
  105.  
  106. s1()
  107.     turtle.turnRight()
  108.     s1()
  109.     turtle.back()
  110.     turtle.select(3)
  111.     turtle.place()
  112.     turtle.turnLeft()
  113. s1()
  114.     turtle.turnRight()
  115.     s1()
  116.     turtle.back()
  117.     turtle.select(3)
  118.     turtle.place()
  119.     turtle.turnLeft()
  120. s1()
  121. turtle.back()
  122. turtle.select(1)
  123. turtle.placeUp()
  124. turtle.forward()   
  125. test()
  126. turtle.turnRight()
  127. for s2 = 1, 4, 1 do
  128.     s1()
  129. end
  130. turtle.turnRight()
  131. turtle.turnRight()
  132. for s2 = 1, 8, 1 do
  133.     s1()
  134. end
  135. turtle.turnRight()
  136. turtle.turnRight()
  137. for s2 = 1, 4, 1 do
  138.     s1()
  139. end
  140. turtle.turnLeft()
  141.  
  142. for strip = 2, gaenge, 1 do
  143.     s1()
  144.     s1()
  145.     s1()
  146.     turtle.back()
  147.     turtle.select(1)
  148.     turtle.placeUp()
  149.     turtle.forward()
  150.     test()
  151.     turtle.turnRight()
  152.     for s2 = 1, 4, 1 do
  153.         s1()
  154.     end
  155.     turtle.turnRight()
  156.     turtle.turnRight()
  157.     for s2 = 1, 8, 1 do
  158.         s1()
  159.     end
  160.     turtle.turnRight()
  161.     turtle.turnRight()
  162.     for s2 = 1, 4, 1 do
  163.         s1()
  164.     end
  165.     turtle.turnLeft()
  166.    
  167.    
  168.    
  169.     -- ENTLEERUNG NACH 30 GAENGEN
  170.     ent = ent+1
  171.     if ent == 20 then
  172.         turtle.turnRight()
  173.         turtle.turnRight()
  174.         goback1 = strip*3
  175.         for goback2 = 2, goback1, 1 do
  176.             turtle.forward()
  177.             test()
  178.         end
  179.         turtle.turnLeft()
  180.         drop()
  181.         turtle.turnLeft()
  182.         for goback2 = 2, goback1, 1 do
  183.             turtle.forward()
  184.             test()
  185.         end
  186.         ent = 0
  187.     end
  188. end
  189.  
  190. back = gaenge*3
  191. turtle.turnRight()
  192. turtle.turnRight()
  193. for goback = 1, back, 1 do
  194.     turtle.forward()
  195.     test()
  196. end
  197.  
  198. -- (C) Zekrommaster110 2015
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement