Pilgrimager

FRPath

Jul 29th, 2021 (edited)
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. # dig/bridge forward and then right
  2. lenF=18
  3. lenR=123
  4. slot = 1
  5.  
  6. function DoOne()
  7.     turtle.digUp()
  8.     turtle.dig()
  9.     if not turtle.detectDown() then
  10.         success, errStr = turtle.placeDown()
  11.         wrapped = False
  12.         while errStr == "No items to place" do
  13.             slot = slot + 1
  14.             if slot==17 and wrapped then
  15.                 print(errStr)
  16.                 error()
  17.             elseif slot==17 then
  18.                 slot=1
  19.                 wrap=True
  20.             end
  21.             turtle.select(slot)
  22.             errStr = ''
  23.             success, errStr = turtle.placeDown()
  24.         end
  25.     end
  26.     turtle.forward()
  27. end
  28.  
  29. if lenF>0 then
  30.     for i=1,lenF do
  31.        DoOne()
  32.     end
  33. end
  34.  
  35. if lenR>0 then
  36.     turtle.turnRight()
  37.     for i=1,lenR do
  38.         DoOne()
  39.     end
  40.     turtle.turnRight()
  41.     DoOne()
  42.     turtle.turnRight()
  43.     for i=1,lenR-1 do
  44.         DoOne()
  45.     end
  46. end
  47. if lenF>0 then
  48.     turtle.turnLeft()
  49.     for i=1,lenF-1 do
  50.         DoOne()
  51.     end
  52. end
  53.  
Add Comment
Please, Sign In to add comment