Advertisement
Guest User

stripmine

a guest
Apr 16th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local tArgs = {...}
  2.  
  3. function mineInteration()
  4.   turtle.dig()
  5.   turtle.forward()
  6.   turtle.digUp()
  7. end
  8.  
  9. function moveBack()
  10.   for i = 1, tArgs[1] do
  11.     turtle.back()
  12.   end
  13. end
  14.  
  15. function nextTunnel()
  16.   turtle.turnRight()
  17.   mineInteration()
  18.   mineInteration()
  19.   mineInteration()
  20.   turtle.turnLeft()
  21. end
  22.  
  23. if tArgs[1] == nil then tArgs[1] = 1 end
  24. if tArgs[2] == nil then tArgs[2] = 1 end
  25. tunnels = tonumber(tArgs[2])
  26. for i = 1, tArgs[2] do
  27.     print("This is Tunnel " ..tostring(i).. ".")
  28.     for i = 1, tArgs[1] do
  29.       mineInteration()
  30.     end
  31.     moveBack()
  32.     if i < tunnels then nextTunnel() end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement