Advertisement
Guest User

Boden

a guest
Aug 23rd, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 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åA4nge> <Breite>")
  12.   return
  13. end
  14.  
  15. function empty()
  16.   if (turtle.getItemCount(slots) == 0) then
  17.     print(string.format("Ich bin leer fåBClle 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.forward()
  30.     turtle.placeDown()
  31.   end
  32.  
  33.  
  34.   if (i % 2 == 0) then
  35.    
  36.     if (i ~= width - 1) then
  37.       turtle.turnRight()
  38.       turtle.forward()
  39.       turtle.turnRight()
  40.       empty()  
  41.       turtle.placeDown()
  42.     end
  43.   else  
  44.     if (i ~= width - 1) then
  45.       turtle.turnLeft()
  46.       turtle.forward()
  47.       turtle.turnLeft()
  48.       empty()
  49.       turtle.placeDown()
  50.     end
  51.   end
  52.  
  53.   if (j ~= length - 1) then
  54.     empty()
  55.     turtle.placeDown()
  56.   end
  57. end
  58.  
  59. print("\nFertig.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement