Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- deploy the miner
- function deploy()
- turtle.select(16)
- turtle.place()
- turtle.select(1)
- end
- -- returns if something was dropped below this turtle
- function clearInv()
- local something = false
- for i = 1, 16 do
- turtle.select(i)
- something = something or turtle.getItemCount(i) > 0
- turtle.dropDown()
- end
- return something
- end
- -- retrieves the miner in the front
- function getMiner()
- turtle.select(16)
- turtle.dropDown()
- turtle.dig()
- turtle.select(1)
- end
- redstone.setOutput("back", false)
- while true do
- -- wait until we find a redstone signal
- -- and maintain this redstone signal until we are done
- if redstone.getInput("back") == true then
- redstone.setOutput("back", true)
- deploy()
- sleep(5)
- -- wait until we deployed something
- while clearInv() == false do
- sleep(math.random(5))
- end
- while clearInv() == true do
- sleep(4 + math.random() * 5)
- end
- clearInv()
- getMiner()
- redstone.setOutput("back", false)
- while redstone.getInput("back") == true do
- sleep(2)
- end
- else
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement