Advertisement
Fadamaka

sampleDrill

Sep 14th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --functions
  2. local function building()
  3. --phase 1
  4.     if turtle.inspectDown()==false then
  5.         turtle.select(6)
  6.         turtle.placeDown()
  7.     end
  8.     turtle.select(1)
  9.     turtle.placeUp()
  10.     turtle.select(2)
  11.     turtle.dropUp()
  12.     redstone.setOutput("top",true)
  13.     os.sleep(1)
  14.     redstone.setOutput("top",false)
  15.     turtle.forward()
  16.     turtle.up()
  17.     turtle.select(3)
  18.     turtle.placeUp()
  19.  
  20.     turtle.down()
  21.     turtle.back()
  22. --phase 2
  23.     os.sleep(31)
  24.  
  25.     turtle.select(1)
  26.     turtle.digUp()
  27.     turtle.up()
  28. end
  29.  
  30. local function veinValidation()
  31. --vein validation
  32.     local s=""
  33.     s = peripheral.call("top","getVeinUnlocalizedName")
  34.    
  35.     if s == nill then
  36.         turtle.select(5)
  37.         turtle.placeDown()
  38.     else
  39.         turtle.select(4)
  40.         turtle.placeDown(s)
  41.     end
  42.  
  43.     turtle.select(2)
  44.     turtle.digUp()
  45.     turtle.forward()
  46.     turtle.select(3)
  47.     turtle.digUp()
  48.     turtle.down()
  49.  
  50. end
  51.  
  52. local function nextChunk()
  53.     local j = 1
  54.     while j <= 15 do
  55.         j = j + 1
  56.         turtle.forward()
  57.     end
  58. end
  59. --execution
  60.  
  61. local i = 0
  62. while i < 30 do
  63.    
  64.     i = i + 1
  65.  
  66.     building()
  67.     veinValidation()
  68.  
  69.     if i%10==0 and i~=0 then
  70.         turtle.turnLeft()
  71.         turtle.forward()
  72.     else
  73.         if i%5==0 and i~=0 then
  74.             turtle.turnRight()
  75.             turtle.forward()
  76.         end
  77.     end
  78.    
  79.     nextChunk()
  80.    
  81.     if i%10==0 and i~=0 then
  82.         turtle.turnLeft()
  83.         turtle.forward()
  84.     else   
  85.         if i%5==0 and i~=0 then
  86.             turtle.turnRight()
  87.             turtle.forward()
  88.         end
  89.     end
  90.  
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement