Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 0
- x = 0
- y = 0
- z = 0
- function getCount()
- c = 0
- for i = 2, 16, 1 do
- c = c + turtle.getItemCount(i)
- end
- return c
- end
- function chest()
- turtle.digUp()
- turtle.select(1)
- turtle.placeUp()
- for a = 2,16,1 do
- turtle.select(a)
- turtle.dropUp()
- end
- n = 0
- turtle.select(1)
- end
- function printCoords()
- print("x = ", x)
- print("y = ", y)
- print("z = ", z)
- end
- function mine()
- while y < h do
- turtle.digDown()
- if turtle.down() then
- y = y + 1
- printCoords()
- end
- while z < l - 2 do
- if turtle.forward() then
- z = z + 1
- printCoords()
- end
- turtle.dig()
- getCount()
- if c > 512 then
- chest()
- end
- print(c)
- end
- while z > 0 do
- if turtle.back() then
- z = z - 1
- printCoords()
- end
- end
- while x < w - 1 do
- if x < w - 1 then
- turtle.turnRight()
- turtle.dig()
- if turtle.forward() then
- x = x + 1
- printCoords()
- end
- turtle.turnLeft()
- end
- turtle.dig()
- while z < l - 2 do
- if turtle.forward() then
- z = z + 1
- printCoords()
- end
- turtle.dig()
- getCount()
- if c > 512 then
- chest()
- end
- print(c)
- end
- while z > 0 do
- if turtle.back() then
- z = z - 1
- printCoords()
- end
- end
- end
- turtle.turnLeft()
- while x > 0 do
- if turtle.forward() then
- x = x - 1
- printCoords()
- end
- end
- turtle.turnRight()
- end
- while y > 0 do
- if turtle.up() then
- y = y - 1
- printCoords()
- end
- end
- end
- print("+-------------------------------------+")
- print("| Mega Quarry |")
- print("+-------------------------------------+")
- print("| Slot 1: Chests |")
- print("+-------------------------------------+")
- print("| Place turtle at bottom left of |")
- print("| quarry. Specify dimensions. |")
- print("| Press enter to start. |")
- print("+-------------------------------------+")
- read()
- print("+-------------------------------------+")
- print("| Quarry length = ? |")
- print("+-------------------------------------+")
- l = tonumber(read())
- print("+-------------------------------------+")
- print("| Quarry width = ? |")
- print("+-------------------------------------+")
- w = tonumber(read())
- print("+-------------------------------------+")
- print("| Quarry height = ? |")
- print("+-------------------------------------+")
- h = tonumber(read())
- mine()
Add Comment
Please, Sign In to add comment