Advertisement
Guest User

mine

a guest
Mar 30th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.19 KB | None | 0 0
  1. shell.run("clear")
  2. print("Bitte in den letzten Slot Kohle, in den ersten Slot Baumaterial legen und hinter die Turtle eine Kiste stellen")
  3. print("\nWie weit? : ")
  4. local Eingabe = read()
  5. local Anzahl = Eingabe
  6. local Back = Eingabe
  7. shell.run("clear")
  8.  
  9. if turtle.getFuelLevel()<1 then
  10.   turtle.select(16)
  11.   turtle.refuel(20)
  12.   turtle.select(1)
  13. end
  14.  
  15. if not tonumber(Anzahl) then
  16.   print("Bitte eine Zahl eingeben")
  17.   sleep(2)
  18.   shell.run("clear")
  19.   shell.run("mine")
  20. end
  21.  
  22. while tonumber(Anzahl) > 0 do
  23.   turtle.dig()
  24.   turtle.forward()
  25.     if not turtle.detectDown() then
  26.       turtle.placeDown()
  27.     end
  28.   turtle.turnRight()
  29.     if not turtle.detect() then
  30.       turtle.place()
  31.     end
  32.   turtle.turnLeft()
  33.   turtle.turnLeft()
  34.     if not turtle.detect() then
  35.       turtle.place()
  36.     end
  37.   turtle.digUp()
  38.   turtle.up()
  39.     if not turtle.detectUp() then
  40.       turtle.placeUp()
  41.     end
  42.     if not turtle.detect() then
  43.       turtle.place()
  44.     end
  45.   turtle.turnRight()
  46.   turtle.turnRight()
  47.     if not turtle.detect() then
  48.       turtle.place()
  49.     end
  50.   turtle.down()
  51.   turtle.turnLeft()
  52.  
  53.   Anzahl = Anzahl - 1
  54.   Back = Back - 1
  55.  
  56. if turtle.getItemCount(15) == 64 then
  57.   Back = Back - 1
  58.  
  59.     while tonumber(Back) <= tonumber(Eingabe) do
  60.        turtle.back()
  61.       print("back"..Back)
  62.        Back = Back + 1
  63.     end
  64.    
  65.     turtle.turnRight()
  66.     turtle.turnRight()
  67.    
  68.     turtle.select(2)
  69.     turtle.drop()
  70.     turtle.select(3)
  71.     turtle.drop()
  72.     turtle.select(4)
  73.     turtle.drop()
  74.     turtle.select(5)
  75.     turtle.drop()
  76.     turtle.select(6)
  77.     turtle.drop()
  78.     turtle.select(7)
  79.     turtle.drop()
  80.     turtle.select(8)
  81.     turtle.drop()
  82.     turtle.select(9)
  83.     turtle.drop()
  84.     turtle.select(10)
  85.     turtle.drop()
  86.     turtle.select(11)
  87.     turtle.drop()
  88.     turtle.select(12)
  89.     turtle.drop()
  90.     turtle.select(13)
  91.     turtle.drop()
  92.     turtle.select(14)
  93.     turtle.drop()
  94.     turtle.select(15)
  95.     turtle.drop()
  96.  
  97.     turtle.turnRight()
  98.     turtle.turnRight()
  99.  
  100.     while Back ~= Anzahl do
  101.       turtle.forward()
  102.       Back = Back - 1
  103.       print("Back = "..Back)
  104.     end
  105.   end
  106.  
  107.   write(""..Anzahl)
  108.   print(" more blocks "..Back)
  109.  
  110. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement