Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function go(dir)
- if dir=="fwd" then
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- end
- elseif dir=="up" then
- while turtle.up() == false do
- turtle.digUp()
- turtle.attackUp()
- end
- elseif dir=="down" then
- while turtle.down() == false do
- turtle.digDown()
- turtle.attackDown()
- end
- elseif dir=="back" then
- while turtle.back() == false do
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.attack()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
- function refuel()
- print("Fuel needed: " .. 8*size + 10)
- print(" ")
- turtle.select(16)
- while turtle.getFuelLevel() < (8*size + 10) do
- if turtle.refuel(1) == false then
- sleep(0.5)
- end
- end
- end
- function items()
- turtle.select(1)
- if turtle.getItemCount(1) < 12 then
- print("Place 12 blocks in the first slot.")
- while turtle.getItemCount(1) < 12 do
- sleep(1)
- end
- end
- end
- function node()
- turtle.digDown()
- turtle.placeDown()
- mark = mark+1
- print(mark .. "/12")
- end
- function line()
- for i=1, size do
- turtle.digUp()
- turtle.dig()
- go(fwd)
- end
- turtle.digUp()
- end
- function edgeUp()
- turtle.turnLeft()
- go(up)
- turtle.digUp()
- go(up)
- turtle.digUp()
- turtle.dig()
- go(fwd)
- turtle.digUp()
- turtle.dig()
- go(fwd)
- turtle.digUp()
- turtle.turnLeft()
- end
- function edge()
- turtle.turnLeft()
- turtle.dig()
- go(fwd)
- turtle.digUp()
- turtle.turnLeft()
- end
- function edgeDown()
- turtle.turnLeft()
- turtle.dig()
- go(fwd)
- turtle.digUp()
- turtle.dig()
- go(fwd)
- turtle.digUp()
- turtle.digDown()
- go(down)
- turtle.digDown()
- go(down)
- turtle.turnLeft()
- end
- -------------------------------------------------------
- up = "up"
- down = "down"
- back = "back"
- fwd = "fwd"
- mark = 0
- write("Quarry size: ")
- size = read() + -1
- while size < 2 or size > 63 do
- print("Invalid size! (Min = 3, Max = 64)")
- size = read() + -1
- end
- refuel()
- items()
- --------------------------------------------------------
- turtle.turnRight()
- node()
- line()
- node()
- edgeUp()
- node()
- line()
- node()
- turtle.turnRight()
- line()
- node()
- edge()
- node()
- line()
- node()
- turtle.turnRight()
- line()
- node()
- edgeDown()
- node()
- line()
- node()
- turtle.turnRight()
- line()
- node()
- edge()
- node()
- line()
- print("done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement