Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ifContinue=true
- Detection=false
- turtle.select(1)
- Torch=false
- Islot=1
- print "Is the next turn left or right?"
- print "Type 1 for right, type 2 for left"
- Turn=io.read()
- function detectFunc()
- if turtle.detect() then
- turtle.select(16)
- if turtle.compare() then
- Detection=false
- Torch=true
- else
- Detection=true
- end
- turtle.select(Islot)
- else
- Detection=false
- end
- end
- function mainFunc()
- if turtle.getItemCount(Islot)==1 then
- if Islot>7 then
- ifContinue=false
- print "Out of blocks"
- else
- Islot=Islot+1
- turtle.select(Islot)
- end
- else
- detectFunc()
- if Torch then
- turtle.dig()
- Torch=false
- end
- if Detection then
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.placeDown()
- if Turn==1 then
- turtle.turnRight()
- detectFunc()
- if detection then
- ifContinue=false
- print "Blocked up ahead"
- else
- if Torch then
- turtle.dig()
- Torch=false
- end
- turtle.forward()
- turtle.turnRight()
- turn=2
- end
- else
- turtle.turnLeft()
- detectFunc()
- if detection then
- ifContinue=false
- print "Blocked up ahead"
- else
- if Torch then
- turtle.dig()
- Torch=false
- end
- turtle.forward()
- turtle.turnLeft()
- turn=1
- end
- end
- else
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.placeDown()
- turtle.forward()
- end
- end
- end
- ifContinue = true
- while ifContinue do
- mainFunc()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement