ivanzrer

digger1

Nov 9th, 2024 (edited)
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. args = {...}
  2. desHeight = tonumber(args[1])
  3. desLength = tonumber(args[2])
  4. desWidth = tonumber(args[3])
  5.  
  6.  
  7. function digLenth (length)
  8.     for i=1, length - 1,1 do
  9.         print(i)
  10.         turtle.dig()
  11.         turtle.forward()
  12.     end
  13.     for i=1, length - 1,1 do
  14.         turtle.back()
  15.     end
  16. end
  17.  
  18. function digWidth (width)
  19.     for i=1, width,1 do
  20.         digLenth(desLength)
  21.         turtle.turnRight()
  22.         turtle.dig()
  23.         turtle.forward()
  24.         turtle.turnLeft()
  25.     end
  26. end
  27.  
  28. function digHeight (height)
  29.     for i=1, height,1 do
  30.         digWidth(desWidth)
  31.         turtle.turnLeft()
  32.         for i=1, desWidth,1 do
  33.             turtle.forward()
  34.         end
  35.         turtle.turnRight()
  36.         turtle.digUp()
  37.         turtle.up()
  38.     end
  39.  
  40.     for i=1, height,1 do
  41.         turtle.down()
  42.     end
  43. end
  44.  
  45. if args[3] == nil then
  46.     term.setTextColor(colors.red)
  47.     print("You must provive all three axis!")
  48.     print("digger [Height] [Length] [Width]")
  49.     term.setTextColor(colors.white)
  50. else
  51.     digHeight(desHeight)
  52. end
  53.  
Advertisement
Add Comment
Please, Sign In to add comment