Advertisement
Guest User

mine.lua

a guest
Nov 12th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. local args = { ... }
  2. local surface
  3. local side
  4.  
  5. if args[1] and args[2] then
  6.     surface = args[1]
  7.     side = args[2]
  8.     if math.mod(side,2) == 0 then
  9.         side = side + 1
  10.     end
  11. else
  12.     print("You must pass two args the surface y level and the dimension of the mined area")
  13.     return nil
  14. end
  15.  
  16. for i=1,surface - 3,1 do
  17.     for x=1,side,1 do
  18.         for y=1,side,1 do
  19.             turtle.digDown()
  20.             turtle.dig()
  21.             if y<tonumber(side) then
  22.                 turtle.forward()
  23.             end
  24.         end
  25.         if x<tonumber(side) then
  26.             if math.mod(x,2) == 0 then
  27.                 turtle.turnRight()
  28.                 turtle.dig()
  29.                 turtle.forward()
  30.                 turtle.turnRight()
  31.             else
  32.                 turtle.turnLeft()
  33.                 turtle.dig()
  34.                 turtle.forward()
  35.                 turtle.turnLeft()
  36.             end
  37.         else
  38.             turtle.down()
  39.             turtle.turnRight()
  40.             for j=1,side-1,1 do
  41.                 turtle.forward()
  42.             end
  43.             turtle.turnRight()
  44.             for j=1,side-1,1 do
  45.                 turtle.forward()
  46.             end
  47.             turtle.turnRight()
  48.             turtle.turnRight()
  49.         end
  50.     end
  51. end
  52.  
  53. for i=1,surface-3,1 do
  54.     turtle.up()
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement