Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- if tArgs[1] == nil then
- term.clear()
- term.setCursorPos(1,1)
- print("Error: Missing Arguments")
- term.setCursorPos(1,2)
- print("radius, current Y, min Y")
- end
- r = tArgs[1]
- currY = tArgs[2]
- minY = tArgs[3]
- function fWrite(f)
- local file = fs.open(f, "w")
- dbs = textutils.serialize(text)
- file.write(dbs)
- file.close()
- end
- function fRead(f)
- local file = fs.open(f, "r")
- text = textutils.unserialize(file.readAll())
- return text
- end
- function getLoc()
- x, y, z = gps.locate(2, true)
- return x, y, z
- end
- function move()
- repeat turtle.forward()
- sleep(1)
- turtle.dig()
- until turtle.forward() == true
- dH = dH + 1
- local text = dH
- fWrite("lDistance")
- end
- function forward(r)
- for i = 1, r do
- if turtle.getFuelLevel() < minFuel() + 1 then
- turtle.select(16)
- if turtle.count == 1 then
- return()
- else
- turtle.refuel()
- move()
- end
- else move()
- end
- end
- end
- function compare()
- for local i = 1, #cSlots do
- turtle.select(cSlots[i])
- if turtle.compareUp() == false then
- turtle.digUp()
- end
- if turtle.compareDown() == false then
- turtle.digDown()
- end
- end
- end
- function load()
- for local i = 1, 15 do
- turtle.select(i)
- local x = turtle.count()
- if x > 0 then
- cSlots[i] = i
- end
- end
- end
- function minFuel()
- fRead("lDistance")
- minFuel = text
- return minFuel
- end
- function layer()
- for local i = 1, r do
- for local i = 1, r do
- for local i = 1, r do
- forward(1)
- end
- turtle.turnLeft()
- forward(1)
- turtle.turnLeft()
- end
- end
- end
- function mineLayer()
- if minY = nil then
- toY = 6
- else toY = minY
- end
- for local i = currY - toY do
- turtle.digDown()
- turtle.down()
- local text = i
- fWrite(mineY)
- end
- layer()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement