Guest User

Untitled

a guest
Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.95 KB | None | 0 0
  1. local x=0
  2. local y=0
  3. local z=0
  4. local z1=0
  5. local length=0
  6. local i=0
  7. local c=0
  8. local b=0
  9. local r=1
  10. local build
  11. local d=0
  12.  
  13. function check()
  14.   while turtle.getItemCount(r)<10 do
  15.     r=r+1
  16.   end
  17.  turtle.select(r)
  18. end
  19.  
  20. function Ground(length)
  21. y=0
  22. x=0
  23.  while y<length do    
  24.    while x<length do
  25.     check()
  26.     turtle.dig()
  27.     turtle.forward()
  28.     turtle.digDown()
  29.     turtle.placeDown()
  30.     x=x+1
  31.    end
  32.     check()
  33.     y=y+1
  34.     if y%2==0 then
  35.      turtle.dig()
  36.      turtle.forward()
  37.      turtle.turnRight()
  38.      turtle.dig()
  39.      turtle.forward()
  40.      turtle.turnRight()
  41.     else
  42.      turtle.dig()
  43.      turtle.forward()
  44.      turtle.turnLeft()
  45.      turtle.dig()
  46.      turtle.forward()
  47.      turtle.turnLeft()
  48.     end
  49.     x=0
  50.   end
  51.  while z<(length+1) do
  52.   check()
  53.   turtle.dig()
  54.   turtle.forward()
  55.   z=z+1
  56.  end
  57.  turtle.turnLeft()
  58.  while z1<length do
  59.   turtle.dig()
  60.   turtle.forward()
  61.   z1=z1+1
  62.  end
  63.  turtle.turnLeft()
  64. end
  65.  
  66. function Reihe(length)
  67. for b=0, 3, 1 do
  68.  for c=0, (length-2), 1 do
  69.    check()
  70.    turtle.placeDown()
  71.    turtle.dig()
  72.    turtle.forward()    
  73.  end
  74.    turtle.turnLeft()
  75. end
  76. end
  77.  
  78. function Wall(length)
  79.   turtle.forward()
  80.  for i=0, 4, 1 do
  81.   turtle.digUp()
  82.   turtle.up()
  83.   Reihe(length)  
  84.  end
  85. end
  86.  
  87. function Skylight()
  88.  for d=0, 3, 1 do
  89.    turtle.select(14)
  90.    turtle.digDown()
  91.    turtle.placeDown()
  92.    turtle.forward()
  93.    turtle.turnRight()
  94.  end
  95. end
  96.  
  97.  
  98. function Dach()
  99.  x=0
  100.  y=0
  101.  z=0
  102.  Skylight()
  103.  turtle.forward()
  104.  turtle.forward()
  105.  turtle.forward()
  106.  Skylight()
  107.  turtle.forward()
  108.  turtle.turnRight()
  109.  turtle.forward()
  110.  turtle.forward()
  111.  turtle.forward()
  112.  Skylight()
  113.  turtle.forward()
  114.  turtle.turnRight()
  115.  turtle.forward()
  116.  turtle.forward()
  117.  turtle.forward()
  118.  Skylight()
  119.  turtle.turnRight()
  120.  turtle.forward()
  121.  turtle.forward()
  122.  turtle.turnLeft()
  123.  for x=0, 5, 1 do
  124.   turtle.back()
  125.  end
  126.  for y=0, 4, 1 do
  127.   turtle.down()
  128.  end
  129.  turtle.dig()
  130.  turtle.down()
  131.  turtle.dig()
  132.  for z=0, 1, 1 do
  133.   turtle.forward()
  134.  end
  135. end
  136.  
  137. function Innen()
  138.  x=0
  139.  turtle.turnLeft()
  140.  for x=0, 2, 1 do
  141.   turtle.forward()
  142.  end
  143.   turtle.turnRight()
  144.  turtle.up()
  145.  for y=0, 2, 1 do
  146.  Fenster()
  147.  turtle.turnRight()
  148.  end
  149.  turtle.forward()
  150.  turtle.turnLeft()
  151.  turtle.dig()
  152.  turtle.place()
  153.  turtle.up()
  154.  turtle.dig()
  155.  turtle.place()
  156.  turtle.turnRight()
  157.  x=0
  158.  for x=0, 3, 1 do
  159.  turtle.forward()
  160.  end
  161.  turtle.turnLeft()
  162.  turtle.dig()
  163.  turtle.place()
  164.  turtle.down()
  165.  turtle.dig()
  166.  turtle.place()
  167.  turtle.back()
  168.  turtle.back()
  169.  turtle.back()
  170.  turtle.turnLeft()
  171.  turtle.forward()
  172.  turtle.forward()
  173.  turtle.up()
  174.  
  175.  
  176. end
  177.  
  178.  
  179. function Fenster()
  180. x=0
  181.  for x=0, 1, 1 do
  182.   turtle.forward()
  183.   turtle.turnLeft()
  184.   turtle.dig()
  185.   turtle.place()
  186.   turtle.up()
  187.   turtle.dig()
  188.   turtle.place()
  189.   turtle.turnRight()
  190.   turtle.forward()
  191.   turtle.turnLeft()
  192.   turtle.dig()
  193.   turtle.place()
  194.   turtle.down()
  195.   turtle.dig()
  196.   turtle.place()
  197.   turtle.turnRight()
  198.   turtle.forward()
  199.  end  
  200.  
  201. end
  202.  
  203. function Finish()
  204.  x=0
  205.   turtle.select(13)
  206.   for x=0, 3, 1 do
  207.    turtle.forward()
  208.    turtle.forward()
  209.    turtle.place()
  210.    turtle.back()
  211.    turtle.back()
  212.    turtle.turnLeft()
  213.   end
  214.   turtle.down()
  215.   turtle.turnRight()
  216.   turtle.forward()
  217.   turtle.forward()
  218.   turtle.forward()
  219.   turtle.select(15)
  220.   turtle.placeDown()
  221.   turtle.forward()
  222.   turtle.forward()
  223.   turtle.turnRight()
  224.   turtle.turnRight()
  225.   turtle.select(16)
  226.   turtle.down()
  227.   turtle.place()
  228.   turtle.turnRight()
  229.   turtle.forward()
  230.   turtle.forward()
  231.   turtle.turnRight()
  232. end  
  233.  
  234.  
  235. term.write(" Welche Laenge soll das Haus haben? ")
  236. length=read()
  237. length=tonumber(length)
  238. term.write(" Working... ")
  239. Ground(length)
  240. Wall(length)
  241. turtle.back()
  242. turtle.up()
  243. Ground(length)
  244.  
  245.   if length==9 then
  246.    turtle.back()
  247.    turtle.back()
  248.    turtle.back()
  249.    turtle.turnRight()
  250.    turtle.forward()
  251.    turtle.forward()  
  252.    turtle.forward()
  253.    Dach()
  254.    Innen()
  255.    Finish()  
  256.   term.write(" Fertig ")
  257.    end
Add Comment
Please, Sign In to add comment