Advertisement
Zekrommaster110

[COMPUTERCRAFT] Room Digging Programm (V1.2 German Version)

Jul 23rd, 2015
6,269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.88 KB | None | 0 0
  1. function drop()
  2.     turtle.select(1)
  3.     turtle.dropDown(64)
  4.     turtle.select(2)
  5.     turtle.dropDown(64)
  6.     turtle.select(3)
  7.     turtle.dropDown(64)
  8.     turtle.select(4)
  9.     turtle.dropDown(64)
  10.     turtle.select(5)
  11.     turtle.dropDown(64)
  12.     turtle.select(6)
  13.     turtle.dropDown(64)
  14.     turtle.select(7)
  15.     turtle.dropDown(64)
  16.     turtle.select(8)
  17.     turtle.dropDown(64)
  18.     turtle.select(9)
  19.     turtle.dropDown(64)
  20.     turtle.select(10)
  21.     turtle.dropDown(64)
  22.     turtle.select(11)
  23.     turtle.dropDown(64)
  24.     turtle.select(12)
  25.     turtle.dropDown(64)
  26.     turtle.select(13)
  27.     turtle.dropDown(64)
  28.     turtle.select(14)
  29.     turtle.dropDown(64)
  30.     turtle.select(15)
  31.     turtle.dropDown(64)
  32.     turtle.select(16)
  33.     turtle.dropDown(64)
  34. end
  35.  
  36.  
  37. -- Begrüßung
  38.  
  39. shell.run("clear")
  40. textutils.slowPrint("Wilkommen beim\nVolumenaushebungsprogramm [v1.2]\nvon Zekro.")
  41. textutils.slowPrint("\n(C) Zekrommaster110 2015\n")
  42. print("Druecke Enter zum fortfahren.")
  43.  
  44. local input = read()
  45.  
  46.  
  47.  
  48. -- First Input
  49.  
  50. shell.run("clear")
  51. print("")
  52. print("     Y           ")
  53. print("     |           ")
  54. print("     |           ")
  55. print("     |           ")
  56. print("     --------- X ")
  57. print("    /            ")
  58. print("   /             ")
  59. print("  Z              ")
  60. print("")
  61.  
  62. write("Y (Hoehe):  ")
  63. local ycord = read()
  64. write("X (Breite): ")
  65. local xcord = read()
  66. write("Z (Tiefe):  ")
  67. local zcord = read()
  68.  
  69. write("\nEs werden ")
  70. write(ycord * xcord * zcord)
  71. write(" Bloecke abgebaut!\n\n")
  72.  
  73. fuel = turtle.getFuelLevel()
  74. needfuel = xcord * ycord * zcord * 2
  75.  
  76. write("Dieser Vorgang wird benoetigen:\n - ")
  77. write(xcord * ycord * zcord * 2)
  78. write(" Fuel\n")
  79. write("Aktuelles Fuel Level:\n - ")
  80. write(fuel)
  81. write(" Fuel\n\n")
  82.  
  83. if fuel > needfuel then
  84.     print("Der Treibstoff ist ausreichend fuer den Vorgang!\n")
  85. end
  86. if fuel < needfuel then
  87.     print("ACHTUNG! Der Treibstoff ist nicht ausreichend fuer den Vorgang! Bitte nachfuellen!")
  88.     write("Benoetigt wird noch ")
  89.     write(needfuel - fuel)
  90.     write(" Fuel.\n\n")
  91.    
  92.     print("Bitte legen sie den benoetigten Brennstoff in das Turtle-Inventar! (AUFRUNDEN!)")
  93.     print("Benutzt werden kann:")
  94.     write(needfuel/80)
  95.     write(" Kohle\n")
  96.     write(needfuel/15)
  97.     write(" Wooden Planks/Log\n\n")
  98.    
  99.     print("Druecke Enter zum auffuellen.")
  100.     local input = read()
  101.    
  102.     shell.run("refuel all")
  103.    
  104.     print("\n")
  105.    
  106. end
  107.  
  108. print("Druecke Enter zum fortfahren.")
  109. local input = read()
  110.  
  111. shell.run("clear")
  112. print("Bitte Legen sie nun eine Truhe in den ersten Slot der Turtle.")
  113. print("Art der Truhe (Wooden Chest, Iron Chest...) ist unrelevant.\n")
  114.  
  115. print("Druecke Enter zum fortfahren.")
  116. local input = read()
  117.  
  118. layervol = xcord * zcord
  119.  
  120. if layervol > 950 then
  121.     shell.run("clear")
  122.     print("ACHTUNG! Bei der angegebenen Layergroesse:\n")
  123.     write(xcord)
  124.     write(" Bloecke x ")
  125.     write(zcord)
  126.     write(" Blocke\n\n")
  127.     print("besteht die Gefahr, dass das Turtle-Inventar voll ist bevor sie es in die Kiste transportieren kann!")
  128.     print("Wenn sie nun fortfahren, koennten Recourcen verloren gehen!\n")
  129.    
  130.     print("Druecke Enter zum fortfahren.")
  131.     local input = read()
  132. end
  133.  
  134.  
  135. -- MAIN PROGRAMM
  136.  
  137. turtle.dig()
  138. shell.run("go forward")
  139. turtle.digDown()
  140. turtle.select(1)
  141. turtle.placeDown()
  142.  
  143. chest = 0
  144.  
  145. for y = 2, ycord, 1 do
  146.  
  147.     for x = 2, xcord, 1 do
  148.    
  149.         for z = 2, zcord, 1 do
  150.             turtle.dig()
  151.             shell.run("go forward")
  152.         end
  153.         turtle.turnRight()
  154.         turtle.turnRight()
  155.         for z = 2, zcord, 1 do
  156.             turtle.dig()
  157.             shell.run("go forward")
  158.         end
  159.         turtle.turnLeft()
  160.         turtle.dig()
  161.         shell.run("go forward")
  162.         turtle.turnLeft()
  163.    
  164.     end
  165.    
  166.     for z = 2, zcord, 1 do
  167.         turtle.dig()
  168.         shell.run("go forward")
  169.     end
  170.     turtle.turnRight()
  171.     turtle.turnRight()
  172.     for z = 2, zcord, 1 do
  173.         turtle.dig()
  174.         shell.run("go forward")
  175.     end
  176.    
  177.     turtle.turnRight()
  178.    
  179.     for backlayer1 = 2, zcord, 1 do
  180.         shell.run("go forward")
  181.     end
  182.    
  183.     turtle.turnRight()
  184.    
  185.     for chestloop = 1, chest, 1 do
  186.         shell.run("go down")
  187.     end
  188.    
  189.     drop()
  190.    
  191.     for chestloop = 1, chest, 1 do
  192.         shell.run("go up")
  193.     end
  194.    
  195.     chest = chest + 1
  196.    
  197.     turtle.digUp()
  198.     shell.run("go up")
  199.    
  200. end
  201.  
  202. for x = 2, xcord, 1 do
  203.    
  204.         for z = 2, zcord, 1 do
  205.             turtle.dig()
  206.             shell.run("go forward")
  207.         end
  208.         turtle.turnRight()
  209.         turtle.turnRight()
  210.         for z = 2, zcord, 1 do
  211.             turtle.dig()
  212.             shell.run("go forward")
  213.         end
  214.         turtle.turnLeft()
  215.         turtle.dig()
  216.         shell.run("go forward")
  217.         turtle.turnLeft()
  218.    
  219.     end
  220.    
  221.     for z = 2, zcord, 1 do
  222.         turtle.dig()
  223.         shell.run("go forward")
  224.     end
  225.     turtle.turnRight()
  226.     turtle.turnRight()
  227.     for z = 2, zcord, 1 do
  228.         turtle.dig()
  229.         shell.run("go forward")
  230.     end
  231.    
  232.     turtle.turnRight()
  233.    
  234.     for backlayer1 = 2, zcord, 1 do
  235.         shell.run("go forward")
  236. end
  237.  
  238. for godown1 = 2, ycord, 1 do
  239.     shell.run("go down")
  240. end
  241.  
  242. turtle.turnRight()
  243.  
  244. drop()
  245.  
  246. -- End
  247.  
  248. shell.run("clear")
  249. print("Vorgang ist abgeschlossen!")
  250. write(xcord * ycord * zcord)
  251. write(" Bloecke wurden erfolgreich abgebaut!")
  252.  
  253.  
  254. -- (C) Zekrommaster110 2015
  255. -- English version will appear.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement