Advertisement
Guest User

stripMine.lua

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. args = {...}
  2. stripAmount = args[1]
  3.  
  4. stripLength = 5
  5. stripsPerChest = 3
  6.  
  7. function strip()
  8.     for i = 1, stripLength do
  9.         t.dig()
  10.         t.forward()
  11.         t.digDown()
  12.     end
  13.  
  14.     t.turnAround()
  15.  
  16.     for i = 1, stripLength do
  17.         t.forward()
  18.     end
  19. end
  20.  
  21. function stripPair()
  22.     t.left()
  23.     strip()
  24.     strip()
  25.     t.right()
  26.     t.placeDown(1)
  27. end
  28.  
  29. function placeChest()
  30.     t.placeDown(2)
  31.     for i = 3, 16 do
  32.         turtle.select(i)
  33.         turtle.dropDown()
  34.     end
  35. end
  36.  
  37. function run()
  38.     stripsSinceChest = 0
  39.     for i = 1, stripAmount do
  40.         for x = 1, 2 do
  41.             t.dig()
  42.             t.forward()
  43.             t.digDown()
  44.         end
  45.  
  46.         stripPair()
  47.         stripsSinceChest = stripsSinceChest + 1
  48.  
  49.         t.dig()
  50.         t.forward()
  51.         t.digDown()
  52.  
  53.         if stripsSinceChest == 3 or i == stripAmount then
  54.             stripsSinceChest = 0
  55.             placeChest()
  56.         end
  57.     end
  58. end
  59.  
  60. run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement