cecell

TurtleDig

Dec 22nd, 2020
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local tArgs = { ... }
  2. local nCount = tArgs[1]
  3.  
  4. if not nCount then
  5.   print("Usage: dig <count>")
  6.   return
  7. end
  8.  
  9. if nCount==0 then
  10.   print("Arg 1, <count> must be greater than zero!")
  11.   return
  12. end
  13.  
  14. while nCount do
  15.   if not turtle.detect() then
  16.     turtle.forward()
  17.     nCount = nCount - 1
  18.   else
  19.     turtle.dig()
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment