Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qSize = 64
- redstone.setAnalogOutput("bottom",0)
- function needsFuel()
- local level=turtle.getFuelLevel()
- if level=="unlimited" or level>500 then
- return false
- else
- turtle.select(16)
- turtle.refuel()
- end
- end
- needsFuel()
- function vooruit(e)
- for i=1,e do
- turtle.forward()
- end
- end
- function clear()
- term.clear()
- term.setCursorPos (1,1)
- end
- function markersPlaatsen()
- print("Markers plaatsen")
- redstone.setAnalogOutput("bottom",15)
- sleep(1)
- end
- function markersActiveren()
- redstone.setAnalogOutput("bottom",0)
- print("Markers activeren")
- turtle.attack()
- sleep(1)
- end
- function miningBack()
- print("Mining turtle naar achter verplaatsen.")
- redstone.setAnalogOutput("bottom",14)
- sleep(1)
- end
- function engineerBack()
- print("Engineer naar achter verplaatsen.")
- redstone.setAnalogOutput("bottom",0)
- sleep(1)
- turtle.back()
- sleep(1)
- end
- function placeQuarry()
- print("Quarry plaatsen")
- redstone.setAnalogOutput("bottom",13)
- sleep(1)
- end
- function sleepMiningTurtle()
- redstone.setAnalogOutput("bottom",0)
- sleep(1)
- print("Mining turtle in slaap stand zetten")
- redstone.setAnalogOutput("bottom",12)
- sleep(3)
- end
- function placeEnergyItemsSleep()
- print("Energy en Item tesseract plaatsen")
- redstone.setAnalogOutput("bottom",0)
- turtle.back()
- turtle.select(1)
- turtle.place()
- turtle.up()
- turtle.forward()
- turtle.select(2)
- turtle.place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- end
- function picupEnergyItems()
- print("Energy en Item tesseract Oppakken")
- redstone.setAnalogOutput("bottom",0)
- turtle.up()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.select(1)
- turtle.digDown()
- turtle.select(2)
- turtle.dig()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- end
- function pickupQuarry()
- print("Quarry oppakken")
- redstone.setAnalogOutput("bottom",11)
- sleep(1)
- end
- function gotoNextStart()
- print("Naar volgende Quarry punt gaan")
- redstone.setAnalogOutput("bottom",0)
- sleep(2)
- redstone.setAnalogOutput("bottom",10)
- sleep(2)
- redstone.setAnalogOutput("bottom",0)
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- vooruit(qSize-1)
- turtle.turnLeft()
- sleep(1)
- end
- function nieuwQuarry()
- markersPlaatsen()
- while true do
- os.pullEvent("redstone")
- getBottomRedstone = redstone.getAnalogInput("bottom")
- print(getBottomRedstone)
- if getBottomRedstone == 15 then
- markersActiveren()
- miningBack()
- engineerBack()
- placeQuarry()
- elseif getBottomRedstone==14 then
- sleepMiningTurtle()
- placeEnergyItemsSleep()
- menu()
- end
- end
- end
- function volgendeQuarry()
- picupEnergyItems()
- pickupQuarry()
- while true do
- os.pullEvent("redstone")
- getBottomRedstone = redstone.getAnalogInput("bottom")
- print(getBottomRedstone)
- if getBottomRedstone == 15 then
- markersActiveren()
- miningBack()
- engineerBack()
- placeQuarry()
- elseif getBottomRedstone==14 then
- sleepMiningTurtle()
- placeEnergyItemsSleep()
- menu()
- elseif getBottomRedstone==13 then
- gotoNextStart()
- markersPlaatsen()
- end
- end
- end
- function menu()
- clear()
- print ("-------------------------------------")
- print ("-- 1. Nieuwe mijn ")
- print ("-- 2. Volgende mijn ")
- print ("-------------------------------------")
- write ("Keuze (1/2): ")
- local keuze = read()
- if keuze=="1" then
- nieuwQuarry()
- elseif keuze=="2" then
- volgendeQuarry()
- else
- print("Er is een verkeerde keuze gemaakt.")
- sleep(1.5)
- menu()
- end
- end
- menu()
Advertisement
Add Comment
Please, Sign In to add comment