From 20bb3d831fbcb7b10866f806b2601f53c356ace2 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sun, 17 Feb 2019 06:27:43 -0500 Subject: [PATCH] tweaks --- milo/plugins/statsView.lua | 3 ++- miners/findSwarm.lua | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/milo/plugins/statsView.lua b/milo/plugins/statsView.lua index c9df94e..0131490 100644 --- a/milo/plugins/statsView.lua +++ b/milo/plugins/statsView.lua @@ -130,6 +130,7 @@ local function createPage(node) { heading = 'Size', key = 'size', width = 5 }, { heading = 'Used', key = 'used', width = 5 }, { heading = 'Perc', key = 'perc', width = 5 }, + -- TODO: add % to each number }, sortColumn = 'name', }, @@ -335,7 +336,7 @@ Unlocked Slots : %d of %d (%d%%) self.unlocked.value = percent self.unlockedLabel.value = string.format('Unlocked Usage: %s%% (%s of %s slots)', - percent, stats.usedUnlockedSlots, stats.usedSlots) + percent, stats.usedUnlockedSlots, stats.unlockedSlots) UI.Tab.draw(self) end diff --git a/miners/findSwarm.lua b/miners/findSwarm.lua index c8c0301..d658838 100644 --- a/miners/findSwarm.lua +++ b/miners/findSwarm.lua @@ -9,6 +9,8 @@ local Util = require('util') local device = _G.device local os = _G.os +local COLUMNS = 4 + local gpt = GPS.getPoint() or error('GPS not found') local scanner = device.neuralInterface if not scanner or not scanner.scan then @@ -93,8 +95,8 @@ local function hijackTurtle(remoteId) end local function getNextPoint(member) - local z = math.floor(chunkIndex / 3) - local x = chunkIndex % 3 + local z = math.floor(chunkIndex / COLUMNS) + local x = chunkIndex % COLUMNS chunkIndex = chunkIndex + 1 @@ -132,11 +134,12 @@ local function run(member) local pt = getNextPoint(member) if pt then turtle.gotoY(pt.y) - repeat + while not turtle._goto(pt) do if abort then break end - until turtle._goto(pt) + os.sleep(.5) + end for _, v in ipairs(locations) do if abort then @@ -148,7 +151,6 @@ local function run(member) turtle.equip('right', 'minecraft:diamond_pickaxe') if Util.size(found) > 0 then paused = true - print('found spawner') local _, b = next(found) print(string.format('%s:%s:%s %s', b.x, b.y, b.z, b.name)) print('press r to continue')