Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qSize = 64
- function needsFuel()
- local level=turtle.getFuelLevel()
- if level=="unlimited" or level>500 then
- return false
- else
- turtle.select(16)
- turtle.refuel()
- end
- end
- function blockENmarker()
- print("Marker plaatsen")
- turtle.select(1)
- turtle.placeDown()
- turtle.up()
- turtle.select(2)
- turtle.placeDown()
- end
- function vooruit(e)
- for i=1,e do
- turtle.forward()
- end
- end
- function buildMine()
- redstone.setAnalogOutput("top",0)
- needsFuel()
- print("Naar marker 1")
- turtle.forward()
- turtle.up()
- blockENmarker()
- print("Naar marker 2")
- vooruit(qSize-1)
- turtle.down()
- blockENmarker()
- print("Naar marker 3")
- turtle.turnRight()
- turtle.turnRight()
- vooruit(qSize-1)
- turtle.turnRight()
- vooruit(qSize-1)
- turtle.down()
- blockENmarker()
- print("Return to start")
- --return to start
- needsFuel()
- turtle.turnRight()
- turtle.turnRight()
- vooruit(qSize-2)
- turtle.down()
- turtle.down()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- redstone.setAnalogOutput("top",15)
- sleep(1)
- end
- function placeQuarry()
- redstone.setAnalogOutput("top",0)
- turtle.forward()
- turtle.select(4)
- turtle.placeUp()
- turtle.back()
- sleep(2)
- redstone.setAnalogOutput("top",14)
- sleep(1)
- end
- function pickupQuarry()
- print("Quarry oppakken")
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(4)
- turtle.digUp()
- turtle.back()
- turtle.turnRight()
- turtle.back()
- redstone.setAnalogOutput("top",13)
- sleep(1)
- end
- function placeInSleep()
- print("Mining turtle in slaapstand zetten")
- redstone.setAnalogOutput("top",0)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- function gotoNextStart()
- print("Naar volgende Quarry punt gaan")
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- vooruit(qSize-1)
- turtle.turnLeft()
- end
- redstone.setAnalogOutput("top",0)
- print("wachtten op top redstone")
- sleep(1)
- while true do
- os.pullEvent("redstone")
- topRedstone = redstone.getAnalogInput("top")
- print(topRedstone)
- if topRedstone==15 then
- buildMine()
- elseif topRedstone==14 then
- turtle.back()
- elseif topRedstone==13 then
- placeQuarry()
- elseif topRedstone==12 then
- placeInSleep()
- elseif topRedstone==11 then
- pickupQuarry()
- elseif topRedstone==10 then
- gotoNextStart()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment