Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. --Mining turtle with fuel refill and dump into chest every x blocks
  2. --Ladders in slot 1
  3. --Fuel in slot 2
  4. --Chests in slot 3
  5.  
  6.  
  7. x = 0
  8. y = 64 --Insert y coord
  9. z = 0
  10.  
  11. --Start of program
  12. turtle.select(2)
  13. turtle.refuel()
  14.  
  15. turtle.forward()
  16. getReady(y)
  17. y = 13
  18. digChannels()
  19.  
  20.  
  21. function getReady(top) --Dig hole to layer 13
  22.     height = top
  23.     turtle.select(1) --Make sure ladders are in slot 1
  24.     while height > 13 do
  25.         turtle.digDown()
  26.         turtle.down()
  27.         height = height - 1
  28.         turtle.dig()
  29.         if turtle.place()==false then
  30.             break
  31.         end
  32.                
  33.     end
  34. end
  35.  
  36.  
  37. function digChannels()
  38.     for i = 1,20 do --Layer 13 row
  39.             turtle.dig()
  40.             turtle.forward()
  41.     end
  42.    
  43.     --turn around
  44.     turtle.digDown()
  45.     turtle.down()
  46.     turtle.left()
  47.     turtle.left()
  48.  
  49.     for i = 1,20 do --Layer 12 row
  50.             turtle.dig()
  51.             turtle.forward()
  52.     end
  53.    
  54.     --turn around
  55.     turtle.digDown()
  56.     turtle.down()
  57.     turtle.left()
  58.     turtle.left()
  59.  
  60.     for i = 1,20 do --Layer 11 row
  61.             turtle.dig()
  62.             turtle.forward()
  63.     end    
  64.    
  65.     --place chest and empty items
  66.     turtle.dig()
  67.     turtle.digDown()
  68.     turtle.down()
  69.     turtle.dig()
  70.     turtle.select(3) --Make sure chests are in slot 3
  71.     turtle.place() --Place chest
  72.    
  73.     turtle.select(4)
  74.     turtle.drop()
  75.     turtle.select(5)
  76.     turtle.drop()
  77.     turtle.select(6)
  78.     turtle.drop()
  79.     turtle.select(7)
  80.     turtle.drop()
  81.     turtle.select(8)
  82.     turtle.drop()
  83.     turtle.select(9)
  84.     turtle.drop()
  85.     turtle.select(10)
  86.     turtle.drop()
  87.     turtle.select(11)
  88.     turtle.drop()
  89.     turtle.select(12)
  90.     turtle.drop()
  91.     turtle.select(13)
  92.     turtle.drop()
  93.     turtle.select(14)
  94.     turtle.drop()
  95.     turtle.select(15)
  96.     turtle.drop()
  97.     turtle.select(16)
  98.     turtle.drop()
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement