Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- shell.run("drill_swap")
- print( os.getComputerLabel() )
- local running = false
- while true do
- if rs.getInput("back") then
- rs.setOutput("left", true)
- rs.setOutput("bottom", true)
- term.clear()
- term.setCursorPos(1,1)
- print("Drilling On")
- sleep(2) -- Delay to make sure rig finished moving
- turtle.drop() -- place drill
- local lastSeen = 0
- while rs.getInput("back") do
- local itemCount = 0
- for n=1,16 do
- itemCount = itemCount + turtle.getItemCount(n)
- sleep(.1)
- end
- if itemCount > 0 then
- rs.setOutput("top", true)
- lastSeen = 0
- rs.setOutput("left", true)
- rs.setOutput("bottom", true)
- else
- rs.setOutput("top", false)
- lastSeen = lastSeen + 1
- end
- if lastSeen > 6 then
- rs.setOutput("left", false)
- rs.setOutput("bottom", false)
- end
- sleep(10) -- hold if out of power/storage
- rs.setOutput("top", false)
- running = true
- end
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Drilling Off")
- if running then
- turtle.transferTo(16)
- turtle.suck()
- end
- os.pullEvent("redstone")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment