Advertisement
Guest User

replace

a guest
Jul 20th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local arg = {...}
  2.  
  3. local x = arg[1]
  4. local y = arg[2]
  5.  
  6. local select = 1
  7.  
  8. function isEnough()
  9.     if turtle.getItemCount( turtle.getSelectedSlot()) < 1 then
  10.                 select = select + 1
  11.                 if select > 16 then
  12.                     select = 1
  13.         end
  14.     end
  15. end
  16.  
  17. function place()
  18.     if turtle.detectDown() then
  19.             turtle.digDown()
  20.  turtle.placeDown()
  21.             else
  22.     turtle.placeDown() 
  23.         end
  24. end
  25.  
  26. turtle.turnRight()
  27. place()
  28.  
  29. for j = 0, (y-1) do
  30.     for i = 0, (x-2) do
  31.         turtle.forward()
  32.         place()
  33.     end
  34.     if j%2 ~= 0 then
  35.         turtle.turnRight()
  36.         turtle.forward()
  37.         place()
  38.         turtle.turnRight()
  39.             else
  40.         turtle.turnLeft()
  41.         turtle.forward()
  42.         place()
  43.         turtle.turnLeft()
  44.     end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement