Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local w = tArgs[1] or 5
- local h = tArgs[2] or 5
- local d = tArgs[3] or 5
- if type(w) ~= "number" then w = tonumber(w) end
- if type(h) ~= "number" then h = tonumber(h) end
- if type(d) ~= "number" then d = tonumber(d) end
- print("Quarry " .. w .. "x" .. h .. " to depth 3x" .. d)
- local home = {
- _x = x,
- _y = y,
- _z = z,
- _r = r
- }
- local mark = {
- _x = x,
- _y = y,
- _z = z,
- _r = r
- }
- function dump(resumeDig)
- print("going home")
- doSend("dumping")
- if resumeDig == nil then resumeDig = false end
- if resumeDig then
- mark._x = x
- mark._y = y
- mark._z = z
- mark._r = r
- end
- goTo(home._x, home._y + 1, home._z, (home._r + 2) % 4)
- dig = {false, false, false}
- goFwd(1)
- print("dumping items")
- for i = 1, 16 do
- turtle.select(i)
- turtle.drop()
- end
- goBack(1)
- dig = {true, true, true}
- if resumeDig then
- doSend("mining")
- goTo(mark._x, mark._y, mark._z, mark._r)
- end
- end
- function checkFull()
- for slot = 1, 16 do
- if turtle.getItemCount(slot) == 0 then return false end
- end
- return true
- end
- print("Home at (" .. home._x .. "," .. home._y .. "," .. home._z .. "," .. home._r .. ")")
- doSend("mining")
- dig = {true, true, true}
- for j = 1, d do
- if j == 1 then goDown(2) else goDown(3) end
- turtle.digDown()
- for i = 1, w do
- goFwd(h - 1)
- if i < w then
- if i % 2 == 1 then
- turnRight()
- goFwd(1)
- turnRight()
- else
- turnLeft()
- goFwd(1)
- turnLeft()
- end
- else
- turnRight()
- turnRight()
- end
- if checkFull() then dump(true) end
- end
- end
- print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment