Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Please not that when all required fields are filled, I will begin mining straight ahead, then progress right")
- print("enter shaft length")
- L = tonumber(read())
- print("enter number of shafts")
- N = tonumber(read())
- print("enter shaft spacing, a shaft spacing of 3 will ensure 100% wall coverage")
- S = tonumber(read())
- turtle.refuel()
- LL = 0
- SS = 0
- NN = 0
- R = 0
- while NN < N do
- Q = 0
- R = 0
- while LL < L do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- LL = LL + 1
- R = 1
- print("moving forward")
- end
- if LL == L then
- if R == 1 then
- turtle.turnLeft()
- turtle.turnLeft()
- print("Turning left at the end of run")
- R = 0
- end
- end
- while LL > 0 do
- turtle.forward()
- print("moving forward after turning around")
- LL = LL - 1
- Q = 1
- end
- if LL == 0 then
- if Q == 1 then
- turtle.turnLeft()
- Q = 0
- print("turning left to start new shaft")
- end
- end
- while SS < S do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- SS = SS + 1
- print("setting spacing")
- if SS == S then
- turtle.turnLeft()
- X = 1
- end
- end
- if SS > 0 then
- if X == 1 then
- SS = 0
- X = 0
- end
- print("reseting spacing counter")
- end
- NN = NN + 1
- print("counting one shaft")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement