Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- redstoneSide = "right"
- empty = false
- sleepCount = 0
- stop = false
- function toggleRedstone(redstoneSide)
- local currentState = rs.getInput(redstoneSide)
- if currentState then
- rs.setOutput(redstoneSide, false)
- else
- rs.setOutput(redstoneSide, true)
- end
- end
- function out()
- redstone.setOutput(redstoneSide, true)
- sleep(0.5)
- while rs.getInput("back") do
- sleep(0.5)
- end
- turtle.place()
- redstone.setOutput(redstoneSide, false)
- sleep(0.5)
- end
- function checkSlot(slot)
- if turtle.getItemDetail(slot) then
- empty = false
- else
- empty = true
- end
- end
- function inc()
- sleepCount = 0
- redstone.setOutput(redstoneSide, true)
- sleep(0.5)
- redstone.setOutput(redstoneSide, false)
- repeat
- sleep(1)
- sleepCount = sleepCount + 1
- if sleepCount == 5 then
- stop = true
- break
- end
- until turtle.detect()
- turtle.dig()
- end
- repeat
- checkSlot(1)
- out()
- checkSlot(1)
- until empty == true
- while stop == false do
- inc()
- end
- item = turtle.getItemDetail(1)
- count = item.count - 1
- term.clear()
- term.setCursorPos(1, 1)
- print("Finished " ..count.. " long tunnel.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement