Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --functions
- local function building()
- --phase 1
- if turtle.inspectDown()==false then
- turtle.select(6)
- turtle.placeDown()
- end
- turtle.select(1)
- turtle.placeUp()
- turtle.select(2)
- turtle.dropUp()
- redstone.setOutput("top",true)
- os.sleep(1)
- redstone.setOutput("top",false)
- turtle.forward()
- turtle.up()
- turtle.select(3)
- turtle.placeUp()
- turtle.down()
- turtle.back()
- --phase 2
- os.sleep(31)
- turtle.select(1)
- turtle.digUp()
- turtle.up()
- end
- local function veinValidation()
- --vein validation
- local s=""
- s = peripheral.call("top","getVeinUnlocalizedName")
- if s == nill then
- turtle.select(5)
- turtle.placeDown()
- else
- turtle.select(4)
- turtle.placeDown(s)
- end
- turtle.select(2)
- turtle.digUp()
- turtle.forward()
- turtle.select(3)
- turtle.digUp()
- turtle.down()
- end
- local function nextChunk()
- local j = 1
- while j <= 15 do
- j = j + 1
- turtle.forward()
- end
- end
- --execution
- local i = 0
- while i < 30 do
- i = i + 1
- building()
- veinValidation()
- if i%10==0 and i~=0 then
- turtle.turnLeft()
- turtle.forward()
- else
- if i%5==0 and i~=0 then
- turtle.turnRight()
- turtle.forward()
- end
- end
- nextChunk()
- if i%10==0 and i~=0 then
- turtle.turnLeft()
- turtle.forward()
- else
- if i%5==0 and i~=0 then
- turtle.turnRight()
- turtle.forward()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement