Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- --how far foreward
- local howFar = 128
- local triesBeforeFailue = 16
- --reverse to begining or wait at end
- --local rtn = true --get back over that lava
- local t = turtle --lazy typing
- local pos = 0
- local try = 0
- --local returnNow = false
- t.select(16) -- slot with torches, or mine will start here, good for nether
- for i = 1, howFar do
- pos = i
- try = 0
- f = t.detect()
- u = t.detectUp()
- d = t.detectDown()
- while f or u or d do
- if f then t.dig(); end
- if u then t.digUp(); end
- if d then t.digDown(); end
- try = try + 1
- if try > triesBeforeFailue then
- print("Attempted "..try.." tries. Attempting continue from pos:"..pos)
- break
- end
- sleep(0.05)
- f = t.detect()
- u = t.detectUp()
- d = t.detectDown()
- if not d and math.fmod(i, 8) == 0 then
- if not t.placeDown() then
- print("I'm scared of the dark:"..pos)
- break
- end
- end
- end
- if not t.forward() then
- print("this baby ain't going nowhere!")
- break
- end
- try = 0
- sleep(0.05)
- end
- print("Got to: "..pos)
- t.turnRight()
- t.turnRight()
- for i = pos, 1, -1 do
- while not t.forward() do
- t.dig()
- end
- sleep(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement