blunderhund

strack

Mar 16th, 2021 (edited)
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local REG_TRACK_COUNT = 37
  2.  
  3. function regTrack()
  4.     turtle.select(1)
  5.     for i = 1, REG_TRACK_COUNT do
  6.         if turtle.detect() == true then
  7.             print("regTrack: Block in the way")
  8.             return false
  9.         else
  10.             print("regTrack: moving forward.")
  11.             turtle.forward()
  12.             print("regTrack: laying track.")
  13.             turtle.placeDown(1)
  14.         end
  15.     end
  16.     return true
  17. end
  18.  
  19. turtle.up()
  20. for i=1, 5 do
  21.     if regTrack() == true then
  22.         print("Reg track complete.")
  23.     else
  24.         print("Reg track error.")
  25.     end
  26. end
  27.  
Add Comment
Please, Sign In to add comment