Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function selectStoneBrick()
- currentSelectedBlock = turtle.getItemDetail()
- if currentSelectedBlock ~= nil then
- for i = 1,16 do
- iBlockDetail = turtle.getItemDetail(i)
- if iBlockDetail ~= nil then
- if iBlockDetail.name == "minecraft:stonebrick" then
- break
- end
- end
- if i == 16 then
- error("oh noes stone brick ran out")
- end
- end
- end
- end
- function forwardDig()
- blockInFront, blockInspect = turtle.inspect()
- if blockInFront then
- turtle.dig()
- end
- turtle.forward()
- end
- function downDig()
- blockDown, blockInspect = turtle.inspectDown()
- if blockDown then
- turtle.digDown()
- end
- turtle.down()
- end
- function upDig()
- blockUp, blockInspect = turtle.inspectUp()
- if blockUp then
- turtle.digUp()
- end
- end
- function clearSpace()
- turtle.turnRight()
- for i = 1, 3 do
- upDig()
- end
- for i = 1, 5 do
- for j = 1, 6 do
- forwardDig()
- end
- turtle.turnRight(2)
- downDig()
- end
- end
- function buildNextBitOfBridge()
- clearSpace()
- end
- function checkFuel()
- fuelLevel = turtle.getFuelLevel()
- if fuelLevel < 50 then
- for i = 1, 16 do
- turtle.select(i)
- turtle.refuel(64)
- end
- end
- end
- function mainLoop()
- while true do
- checkFuel()
- buildNextBitOfBridge()
- end
- end
- mainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement