Advertisement
jdroid91

granites

Oct 19th, 2023 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local currentSlot = 1
  2.  
  3. function checkSlot()
  4.     if (turtle.getItemCount(currentSlot) == 0)
  5.     then
  6.         currentSlot = currentSlot + 1
  7.         turtle.select(currentSlot)
  8.     end
  9. end
  10.  
  11. function graniteSaysDigForward(lengthToDig)
  12.     local index = 0
  13.     while (index < lengthToDig)
  14.     do
  15.         turtle.digDown()
  16.         checkSlot()
  17.         turtle.placeDown()
  18.         turtle.forward()
  19.         index = index + 1
  20.     end
  21. end
  22.  
  23. local index2 = 0
  24. local lengthToDigX = 9
  25. local lengthToDigY = 9
  26. while (index2 < lengthToDigY)
  27. do
  28.   graniteSaysDigForward(lengthToDigX)
  29.   if (index2 % 2 == 0)
  30.   then
  31.     turtle.turnRight()
  32.     turtle.forward()
  33.     turtle.turnRight()
  34.     turtle.forward()
  35.   else
  36.     turtle.turnLeft()
  37.     turtle.forward()
  38.     turtle.turnLeft()
  39.     turtle.forward()
  40.   end
  41.   index2 = index2 + 1
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement