Advertisement
Guest User

mine

a guest
Jul 22nd, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. -- 14 coal
  2. -- 15 torch
  3. -- 16 ender chest
  4. D=16  --how far to go
  5. T=3  --tunnel
  6. C=16  --how far left and right chanel go
  7. function CINV()
  8.  if turtle.getItemCount(13) > 0 then
  9.   turtle.digUp()
  10.   turtle.select(16)
  11.   turtle.placeUp()
  12.    for invs=1,13 do
  13.     turtle.select(invs)
  14.     turtle.dropUp()
  15.    end
  16.   turtle.select(16)
  17.   turtle.digUp()
  18.   turtle.select(15)
  19.  end
  20. end
  21. function CRF()
  22.   if turtle.getFuelLevel() <= 100 then
  23.    turtle.select(14)
  24.    turtle.refuel(1)
  25.    turtle.select(15)
  26.   end
  27. end
  28.  
  29. function FWRD()
  30.   if turtle.forward() == false then
  31.    repeat
  32.     turtle.dig()
  33.     CINV()
  34.     sleep(0.25)
  35.    until turtle.forward() == true
  36.   end
  37. end
  38.  
  39. function TUNL()
  40.  turtle.digUp()
  41.  CINV()
  42.  turtle.dig()
  43.  CINV()
  44.  CRF()
  45.  FWRD()
  46. end
  47.  
  48. function CHAN()
  49.  turtle.dig()
  50.  CINV()
  51.  CRF()
  52.  FWRD()
  53.  turtle.digUp()
  54.  CINV()
  55. end
  56.  
  57. --start
  58.  
  59. for i=1,D do --
  60.   for i=1,T do
  61.    TUNL()
  62.   end
  63.  turtle.digUp()
  64.  CINV()
  65.  turtle.turnLeft()
  66.   for i=1,C do
  67.    CHAN()
  68.   end
  69.  turtle.select(15)
  70.  turtle.placeUp()
  71.  turtle.suckUp()
  72.  turtle.turnLeft()
  73.  turtle.turnLeft()
  74.  P=0
  75.   for i=1,C do
  76.       P=P+1
  77.        if P == 8 then
  78.      turtle.select(15)
  79.         turtle.placeUp()
  80.      turtle.suckUp()
  81.        end
  82.       CRF()
  83.       FWRD()
  84.   end
  85.   for i=1,C do
  86.    CHAN()
  87.   end
  88.   turtle.select(15)
  89.  turtle.placeUp()
  90.  turtle.suckUp()
  91.  turtle.turnLeft()
  92.  turtle.turnLeft()
  93.  P=0
  94.   for i=1,C do
  95.       P=P+1
  96.        if P == 8 then
  97.      turtle.select(15)
  98.        turtle.placeUp()
  99.      turtle.suckUp()
  100.        end
  101.       CRF()
  102.    FWRD()
  103.   end
  104.   CRF()
  105.   turtle.turnRight()
  106. end
  107. turtle.turnLeft()
  108. turtle.turnLeft()
  109. for i=1,D*T do
  110.  FWRD()
  111. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement