Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function tryMove()
- while turtle.getFuelLevel() == 0 do
- for i = 1, 16 do
- turtle.select(i)
- if turtle.refuel(1) then
- break
- end
- end
- turtle.select(1)
- end
- end
- local function up()
- tryMove()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- local function down()
- tryMove()
- while not turtle.down() do
- turtle.digDown()
- end
- end
- local function forward()
- tryMove()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local dir = 0
- local dx = 0
- local dy = 0
- local lastx = 0
- local lasty = 0
- local x = 0
- local y = 0
- local height = 0
- local function searchItems()
- end
- local function returnHome()
- end
- local function invHasItems()
- for i = 1, 16 do
- if turtle.getItemCount() ~= 0 then
- return true
- end
- end
- return false
- end
- local function dropItems()
- local empty = true
- for i = 1, 16 do
- turtle.select(i)
- turtle.drop()
- if turtle.getItemCount() ~= 0 then
- empty = false
- end
- end
- return empty
- end
- local function emptyInventory()
- turtle.turnRight()
- turtle.turnRight()
- local empty = false
- while not empty do
- empty = dropItems()
- if not empty then
- tryMove()
- turtle.up()
- height = height + 1
- end
- end
- local function resumeSearch()
- end
- while true do
- while searchItems() do end
- returnHome()
- emptyInventory()
- resumeSearch()
- end
Add Comment
Please, Sign In to add comment