Advertisement
SythsGod

Untitled

Jan 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. blocksMoved = 0
  2. invSlot = 1
  3. torchSlot = 16
  4. length = 30
  5.  
  6. function placeBlocks()
  7.     if blocksMoved >= 4 then
  8.         turtle.placeDown()
  9.         placeTorch()
  10.         blocksMoved = 0
  11.         turtle.select(invSlot)
  12.     else
  13.         turtle.placeDown()
  14.         turtle.forward()
  15.         blocksMoved = blocksMoved + 1
  16.     end
  17. end
  18.  
  19. function moveOver()
  20.     turtle.turnRight()
  21.     for i = 0, 5 do
  22.         turtle.forward()
  23.     end
  24.     turtle.turnRight()
  25.     turtle.forward()
  26. end
  27.  
  28. function placeTorch()
  29.     turtle.select(torchSlot)
  30.     turtle.up()
  31.     turtle.placeDown()
  32.     turtle.forward()
  33.     turtle.down()
  34. end
  35.  
  36. function run()
  37.     for i = 0, 1 do
  38.         for i = 0, length do
  39.             placeBlocks()
  40.  
  41.             if turtle.getItemCount(invSlot) < 1 then
  42.                 return
  43.             else
  44.                 if turtle.getItemCount(invSlot + 1) < 1 and turtle.getItemCount(invSlot) < 1 then
  45.                     return
  46.                 elseif turtle.getItemCount(invSlot) < 1 then
  47.                     invSlot = invSlot + 1
  48.                 end
  49.  
  50.                 turtle.select(invSlot)
  51.             end
  52.         end
  53.  
  54.         moveOver()
  55.     end
  56. end
  57.  
  58. run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement