Advertisement
kssr3951

tunnel2

May 2nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. -- ========================
  2. -- == tunnel2
  3. -- ========================
  4. dofile("turtleMoveApi")
  5. DEFAULT_HEIGHT = 4
  6. DEFAULT_WIDTH = 4
  7. args = { ... }
  8. if 0 == #args then
  9.     print("usage")
  10.     print("  tunnel2 depth <height> <width>")
  11.     print("arguments")
  12.     print("  depth  : forward direction")
  13.     print("  height : upward direction. default is " .. tostring(DEFAULT_HEIGHT))
  14.     print("  width  : right direction. default is " .. tostring(DEFAULT_WIDTH))
  15.     return
  16. end
  17. depth = tonumber(args[1])
  18. if 2 <= #args then height = tonumber(args[2]) else height = DEFAULT_HEIGHT end
  19. if 3 <= #args then width  = tonumber(args[3]) else width  = DEFAULT_WIDTH  end
  20. registScript(
  21.     rep(depth,
  22.         rep(width,
  23.             rep(height-1,e0,u),
  24.             rep(height-1,d),
  25.             anotherLast({r,e1,f,l}, {})
  26.         ),
  27.         l,
  28.         rep(width-1,f),
  29.         r,e1,f
  30.     )
  31. )
  32. executeScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement