Advertisement
pson

Wall.lua

Jul 8th, 2020
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. function restock()
  2.     local i
  3.  
  4.     i=3
  5.     while i<=16 and turtle.getItemCount(2) < 64 do
  6.         turtle.select(i)
  7.         if turtle.compareTo(2) then
  8.             turtle.transferTo(2)
  9.         end
  10.         i = i+1
  11.     end
  12.     turtle.select(2)
  13. end
  14.  
  15. function singleStep()
  16.     if turtle.getFuelLevel() < 10 then
  17.         turtle.select(1)
  18.         turtle.refuel(1)
  19.     end
  20.     if turtle.getItemCount(2) < 3 then
  21.         restock()
  22.     end
  23.     turtle.select(2)
  24.     turtle.placeDown()
  25.     turtle.forward()
  26. end
  27.  
  28. function main()
  29.     local i, j
  30.  
  31.     turtle.up()
  32.     for i=1,4,1 do
  33.         for j=1,49,1 do
  34.             singleStep()
  35.         end
  36.         turtle.turnRight()
  37.     end
  38. end
  39. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement