Advertisement
Guest User

Boden2

a guest
Aug 23rd, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. arg = {...}
  2.  
  3. length = arg[1]
  4. width = arg[2]
  5.  
  6.  
  7. slots = 16
  8.  
  9.  
  10. if (length == nil or width == nil) then
  11.   print ("Muss so: Boden <LåA5A4nge> <Breite>")
  12.   return
  13. end
  14.  
  15. function empty()
  16.   if (turtle.getItemCount(slots) == 0) then
  17.     print(string.format("Ich bin leer fåA5BClle neues Material in Slot %d.", slots))
  18.     while (turtle.getItemCount(slots) == 0) do
  19.       sleep(1)
  20.     end  
  21.   end
  22. end
  23.  
  24.  
  25. for i=0,(width - 1),1 do
  26.  
  27.   for j=1,(length - 1),1 do
  28.     empty()
  29.   turtle.dig()
  30.     turtle.forward()
  31.    turtle.digDown()
  32.     turtle.placeDown()
  33.   end
  34.  
  35.  
  36.   if (i % 2 == 0) then
  37.    
  38.     if (i ~= width - 1) then
  39.       turtle.turnRight()
  40.       turtle.dig()
  41.       turtle.forward()
  42.       turtle.turnRight()
  43.       empty()  
  44.       turtle.digDown
  45.       turtle.placeDown()
  46.     end
  47.   else  
  48.     if (i ~= width - 1) then
  49.       turtle.turnLeft()
  50.       turtle.dig()
  51.       turtle.forward()
  52.       turtle.turnLeft()
  53.       empty()
  54.       turtle.digDown()
  55.       turtle.placeDown()
  56.     end
  57.   end
  58.  
  59.   if (j ~= length - 1) then
  60.     empty()
  61.     turtle.digDown()
  62.     turtle.placeDown()
  63.   end
  64. end
  65.  
  66. print("\nFertig.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement