K0ne28

Computercraft Turtle Steinfliesen Boden

Nov 17th, 2023
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | Gaming | 0 0
  1. function checkInventory(curSlot)
  2.     if turtle.getItemCount(curSlot) == 0 and curSlot < 16 then
  3.         print(curSlot)
  4.         curSlot = curSlot + 1
  5.         print(curSlot)
  6.     end
  7.     turtle.select(curSlot)
  8.     return curSlot
  9. end
  10.  
  11. function rotate(i)
  12.     if i ~= 1 then
  13.         if i%2 == 0 then
  14.                turtle.turnLeft()
  15.             turtle.forward()
  16.             turtle.turnLeft()
  17.         else
  18.             turtle.turnRight()
  19.             turtle.forward()
  20.             turtle.turnRight()
  21.         end
  22.      end        
  23. end
  24.  
  25. print("länge")
  26. local len = read()
  27. len = len - 1
  28. print("breite")
  29. local wid = read()
  30.  
  31. curSlot = 1
  32.  
  33. for i=1, wid do
  34.     rotate(i)
  35.     for j=1, len do
  36.         curSlot = checkInventory(curSlot)
  37.         turtle.digDown()
  38.         turtle.placeDown()
  39.         turtle.forward()
  40.     end
  41.     curSlot = checkInventory(curSlot)
  42.     turtle.digDown()
  43.     turtle.placeDown()
  44. end
Tags: floor
Add Comment
Please, Sign In to add comment