Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- length = args[1]+0 -- bugfixes string
- count = args[2]+0
- if length == 0 or length == nil then
- print("Nothing to do, shutting down!")
- return(0)
- end
- print("Now running Zonkotron Miner V 0.1")
- print("Loescher Boehren!")
- print("length:".. length)
- print("count:" .. count)
- function turn() -- Turns 180
- turtle.turnRight()
- turtle.turnRight()
- end
- function tDig(x) -- Digs a tunnel 3 label set ZONK
- for i=1,x,1 do
- while turtle.detect() do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- if turtle.detectDown() then
- turtle.digDown()
- end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- end -- end of for 1,x,1
- end -- end of tDig()
- function sDig(y) -- Digs in a straight line
- for i=1,y,1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- end -- end function
- if count == nil or count == 0 then
- turtle.up()
- turtle.up()
- tDig(length)
- turn()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- sDig(length)
- turn()
- else
- for i=1,count,1 do
- turtle.turnRight()
- turtle.up()
- turtle.up()
- tDig(length)
- turn()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- sDig(length)
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turn()
- end
- end
- print("Finished!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement