DarkJMKnight

justgo.lua

May 22nd, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tArgs={...}
  2. if tArgs[1] == nil then return end
  3.  
  4. function processone()
  5.   local success = true
  6.   local downcnt = 0
  7.   while success do
  8.     for x=1,4 do
  9.       turtle.dig()
  10.       turtle.turnRight()
  11.     end
  12.     turtle.digDown()
  13.     success = turtle.down()
  14.     if success then downcnt = downcnt + 1 end
  15.   end
  16.   for x=1,downcnt do
  17.     turtle.up()
  18.   end
  19. end
  20.  
  21. function processmany(cnt)
  22.   for m=1,tonumber(cnt) do
  23.     print(m)
  24.     processone()
  25.     turtle.forward()
  26.   end
  27. end
  28.  
  29. processmany(tArgs[1])
  30.  
Add Comment
Please, Sign In to add comment