Advertisement
CelticCoder

turtleForward

Jan 6th, 2024 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  1. -- Function to attempt to move forward, dig if blocked, and repeat until successful
  2. function moveForward()
  3.     while not turtle.forward() do
  4.         if turtle.detect() then
  5.             turtle.dig()
  6.         else
  7.             print("Something is blocking the way.")
  8.         end
  9.     end
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement