Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local digTunnelModule = {}
- function digTunnelModule.digIt()
- print("Quantos blocos? (num)")
- hM = tonumber(read())
- print("Retornar ao final? (s/n)")
- retYN = read()
- print("Colocar tochas? (s/n)")
- putTorch = read()
- torchDist = 4
- torchCount = 0
- count = 0
- while (count < hM) do
- while turtle.dig() do
- sleep(0.5)
- end
- if (turtle.forward()) then
- count = count + 1
- torchCount = torchCount + 1
- end
- while turtle.digUp() do
- sleep(0.5)
- end
- turtle.up()
- while turtle.digUp() do
- sleep(0.5)
- end
- if (torchCount == torchDist) and (putTorch == 's') then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- torchCount = 0
- end
- turtle.down()
- end
- count = 0
- if (retYN == 's') then
- turtle.turnLeft()
- turtle.turnLeft()
- while (count < hM) do
- if (turtle.forward()) then
- count = count + 1
- end
- end
- end
- end
- return digTunnelModule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement