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: " .. (3+comeback)*size)
- print(" ")
- turtle.select(16)
- while turtle.getFuelLevel() < ((3+comeback)*size) do
- if turtle.refuel(1) == false then
- sleep(0.5)
- end
- end
- end
- function items()
- turtle.select(1)
- if turtle.getItemCount(1) < 3 then
- print("Place 3 blocks in the first slot.")
- while turtle.getItemCount(1) < 3 do
- sleep(1)
- end
- end
- end
- function node()
- turtle.digDown()
- turtle.placeDown()
- end
- function line()
- for i=1, size do
- turtle.digUp()
- turtle.dig()
- go(fwd)
- end
- turtle.digUp()
- end
- function turnBack()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- -------------------------------------------------------
- up = "up"
- down = "down"
- back = "back"
- fwd = "fwd"
- write("Quarry size: ")
- size = read() + -1
- while size < 2 or size > 63 do
- print("Invalid size! (Min = 3, Max = 64)")
- size = read() + -1
- end
- write("Return back? (1=Yes, 0=No): ")
- comeback = read() + 0
- if comeback ~= 1 then
- comeback = 0
- end
- refuel()
- items()
- --------------------------------------------------------
- node()
- line()
- node()
- turnBack()
- line()
- turtle.turnLeft()
- line()
- node()
- if comeback == 1 then
- turnBack()
- line()
- end
- print("done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement