SHARE
TWEET

Untitled

a guest May 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function selectStoneBrick()
  2.     currentSelectedBlock = turtle.getItemDetail()
  3.     if currentSelectedBlock ~= nil then
  4.         for i = 1,16 do
  5.             iBlockDetail = turtle.getItemDetail(i)
  6.             if iBlockDetail ~= nil then
  7.                 if iBlockDetail.name == "minecraft:stonebrick" then
  8.                     break
  9.                 end
  10.             end
  11.             if i == 16 then
  12.                 error("oh noes stone brick ran out")
  13.             end
  14.         end
  15. end
  16.  
  17. function forwardDig()
  18.     blockInFront, blockInspect = turtle.inspect()
  19.     if blockInFront then
  20.         turtle.dig()
  21.     end
  22.     turtle.forward()
  23. end
  24.  
  25. function downDig()
  26.     blockDown, blockInspect = turtle.inspectDown()
  27.     if blockDown then
  28.         turtle.digDown()
  29.     end
  30.     turtle.down()
  31. end
  32.  
  33. function upDig()
  34.     blockUp, blockInspect = turtle.inspectUp()
  35.     if blockUp then
  36.         turtle.digUp()
  37.     end
  38. end
  39.  
  40. function clearSpace()
  41.     turtle.turnRight()
  42.     for i = 1, 3 do
  43.         upDig()
  44.     end
  45.     for i = 1, 5 do
  46.         for j = 1, 6 do
  47.             forwardDig()
  48.         end
  49.         turtle.turnRight(2)
  50.         downDig()
  51.     end
  52. end
  53.  
  54. function buildNextBitOfBridge()
  55.     clearSpace()
  56. end
  57.  
  58. function checkFuel()
  59.     fuelLevel = turtle.getFuelLevel()
  60.     if fuelLevel < then
  61.         for i = 1, 16 do
  62.             turtle.select(i)
  63.             turtle.refuel(64)
  64.         end
  65.     end
  66. end
  67.  
  68. function mainLoop()
  69.    while true do
  70.        checkFuel()
  71.        buildNextBitOfBridge()
  72.    end
  73. end
  74.  
  75. mainLoop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top