Advertisement
NuAoA

StripMine 0.2

Mar 23rd, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. --StripMine Nuaoa 0.1
  2. local targs = { ... }
  3. local width = 1
  4. local t = 16 --TorchSlot
  5. local tl = 10 -- Torch Length
  6. function fuelcheck()   
  7.     for i=1,16 do
  8.         if turtle.getFuelLevel() > 80 then
  9.             break
  10.         end
  11.         turtle.select(i)
  12.         turtle.refuel(1)
  13.     end
  14. end
  15.  
  16. function torchplace()
  17.     turtle.select(t)
  18.     turtle.digDown()
  19.     return turtle.placeDown()
  20. end
  21.  
  22. function tunnel(len,bool)  
  23.     for i =1,len do
  24.         fuelcheck()
  25.         while turtle.detect() do
  26.             turtle.dig()
  27.             sleep(0.4)
  28.         end
  29.         while turtle.detectDown() do
  30.             turtle.digDown()
  31.             sleep(0.4)
  32.         end
  33.        
  34.         if ( i%tl == 0 or i==1 or i==len) and bool then
  35.             if not torchplace() then
  36.                 error("No Torches Left")
  37.             end
  38.         end
  39.         turtle.forward()       
  40.     end
  41. end
  42. function scanAndDrop()
  43.     for i =1,14 do
  44.         turtle.select(i)
  45.         if turtle.compareTo(15) then
  46.             turtle.drop()
  47.         end
  48.     end
  49. end
  50.  
  51. if targs[2] ~= nil then
  52.     width = targs[2]
  53. end
  54. local right = false
  55. for j=1,width do
  56.     if j%8 == 0 or j==1 or j==width then
  57.         tunnel(targs[1],true)
  58.     else
  59.         tunnel(targs[1],false)
  60.     end
  61.     if right then
  62.         turtle.turnRight()
  63.         tunnel(1,false)
  64.         turtle.turnRight()             
  65.     else
  66.         turtle.turnLeft()
  67.         tunnel(1,false)
  68.         turtle.turnLeft()
  69.     end
  70.     right = not right
  71.     scanAndDrop()
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement