From 408687e4f99d9f9ffd310d4e41ccc5e9e51d5838 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 25 Jan 2019 16:16:21 -0500 Subject: [PATCH] miner tweaks --- miners/simpleMiner.lua | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/miners/simpleMiner.lua b/miners/simpleMiner.lua index 199e88e..4985d19 100644 --- a/miners/simpleMiner.lua +++ b/miners/simpleMiner.lua @@ -162,9 +162,10 @@ local function nextChunk() end local function addTrash() - if not trash then - trash = { } + trash = { + [ 'minecraft:cobblestone:0' ] = true + } end local slots = turtle.getFilledSlots() @@ -296,7 +297,7 @@ local function normalChestUnload() safeGoto(0, 0, 0) if not turtle.detectUp() then - error('no chest') + error('Chest above starting point not found') end local slots = turtle.getFilledSlots() for _,slot in pairs(slots) do @@ -321,7 +322,6 @@ local function normalChestUnload() end local function ejectTrash() - local cobbleSlotCount = 0 turtle.eachFilledSlot(function(slot) @@ -575,6 +575,11 @@ mining.z = 0 mining.locations = getBoreLocations(0, 0) trash = Util.readTable(TRASH_FILE) +if fs.exists(PROGRESS_FILE) then + mining = Util.readTable(PROGRESS_FILE) +end + +--[[ if options.resume.value then mining = Util.readTable(PROGRESS_FILE) elseif fs.exists(PROGRESS_FILE) then @@ -582,9 +587,12 @@ elseif fs.exists(PROGRESS_FILE) then print('Teminate or enter to continue') read() end +]] if not trash or options.setTrash.value then - print('Add blocks to ignore, press enter when ready') + print('Place the blocks to ignore into the turtle') + print('Example: stone, dirt, gravel') + print('\nPress enter when ready') read() addTrash() end @@ -620,7 +628,7 @@ local function main() until not nextChunk() end -turtle.run(function() +local s, m = turtle.run(function() turtle.reset() turtle.set({ attackPolicy = 'attack', @@ -639,3 +647,7 @@ turtle.run(function() unload() turtle.reset() end) + +if not s and m then + error(m) +end