Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- toGo = tonumber tArgs[1]
- blocksDug = 0
- blocksPlaced = 0
- torchesPlaced = 0
- term.clear()
- term.setCursorPos(1, 1)
- function tunnel(dist)
- for i=1, dist do
- if turtle.dig() then
- blocksDug += 1
- end
- turtle.digUp()
- turtle.forward()
- if turtle.detectDown() then
- if turtle.placeDown() then
- blocksPlaced += 1
- end
- end
- if i % 10 == 0 then
- turtle.select(16)
- if turtle.placeUp() then
- torchesPlaced += 1
- end
- turtle.select(1)
- end
- return "done"
- end
- while not tunnel(toGo) == "done" do
- term.clear()
- term.setCursorPos(1, 1)
- term.write("Digging a tunnel "..tostring(toGo).." blocks long.")
- term.setCursorPos(1, 2)
- term.write("Blocks dug: "..tostring(blocksDug))
- term.setCursorPos(1, 3)
- term.write("Blocks placed(for bridges): "..tostring(blocksPlaced))
- term.setCursorPos(1, 4)
- term.write("Torches placed: "..tostring(torchesPlaced))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement