Advertisement
Georggi

Tunnel 3x1 without fun and enderchest!

Jun 19th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.92 KB | None | 0 0
  1. i=8
  2. h=0
  3. a=0
  4. m=0
  5. function NeedChest()
  6.     if turtle.getItemCount(2)==0 then
  7.         term.clear()
  8.         print("Give me Chests in 2nd slot!")
  9.         sleep(10)
  10.         NeedChest()
  11.     end
  12.    
  13. end
  14. function checkForLava()
  15.     success, data = turtle.inspectDown()
  16.     if success then
  17.         if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
  18.             turtle.select(3)
  19.             turtle.placeDown()
  20.             turtle.refuel()
  21.             turtle.select(4)
  22.         end
  23.     end    
  24. end
  25. function NeedTorch()
  26.     if turtle.getItemCount(1)==0 then
  27.         term.clear()
  28.         print("Give me Torches in 1st slot!")
  29.         sleep(10)
  30.         NeedTorch()
  31.     end
  32.    
  33. end
  34. function GravelAhead()
  35.     m=1
  36.     while m==1 do
  37.             if turtle.detect() then
  38.                 turtle.dig()
  39.                 sleep(0.5)
  40.             end
  41.             if turtle.detect()==false then
  42.                 m=0
  43.             end  
  44.     end
  45. end
  46. function GravelUp()
  47.     m=1
  48.     while m==1 do
  49.             if turtle.detectUp() then
  50.                 turtle.digUp()
  51.                 sleep(0.5)
  52.             end
  53.             if turtle.detectUp()==false then
  54.                 m=0
  55.             end  
  56.     end
  57. end
  58. function chest()
  59.   if turtle.getItemCount(16)>0 then
  60.     turtle.digDown()
  61.     turtle.down()
  62.     turtle.digDown()
  63.     turtle.select(2)
  64.     turtle.placeDown()
  65.      
  66.     for h=1,13 do
  67.        turtle.select(h+3)
  68.        turtle.dropDown()
  69.     end
  70.     turtle.up()
  71.   end
  72.   turtle.select(4)  
  73.   NeedChest()
  74. end
  75.  
  76.  
  77. function torch()  
  78.   while i==0 do
  79.     turtle.select(1)
  80.     turtle.turnLeft()
  81.     turtle.dig()
  82.     turtle.place()
  83.     turtle.turnRight()    
  84.     i=i+8
  85.     NeedTorch()
  86.   end
  87.   turtle.select(4)
  88. end
  89.  
  90.  
  91. function Mine()
  92. while true do
  93.   if i>0 then
  94.     turtle.dig()
  95.     chest()
  96.     turtle.forward()
  97.     checkForLava()
  98.     GravelAhead()
  99.     turtle.digUp()
  100.     GravelUp()
  101.     chest()
  102.     turtle.digDown()
  103.     chest()
  104.     i=i-1
  105.     torch()
  106.   end
  107. end
  108. end
  109.  
  110. term.clear()
  111. print("Give me some torches please in 1st slot and some chests in 2nd slot!")
  112. NeedTorch()
  113. NeedChest()
  114. Mine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement