diff --git a/farms/farm.lua b/farms/farm.lua index 901398f..297e54e 100644 --- a/farms/farm.lua +++ b/farms/farm.lua @@ -91,6 +91,7 @@ local function harvest(blocks) end end dropped = true + turtle.condense() turtle.select(1) end elseif b.action == 'smash' then diff --git a/milo/Milo.lua b/milo/Milo.lua index 2460867..722c725 100644 --- a/milo/Milo.lua +++ b/milo/Milo.lua @@ -109,9 +109,10 @@ Event.on('milo_cycle', function() for _, task in ipairs(context.tasks) do local s, m = pcall(function() task:cycle(context) end) if not s and m then - _debug(task.name .. ' crashed') - Util.print(task.name .. ' crashed') - error(m) + _G._debug(task.name .. ' crashed') + _G._debug(m) + -- _G.printError(task.name .. ' crashed') + -- _G.printError(m) end end context.turtleBusy = false diff --git a/milo/MiloRemote.lua b/milo/MiloRemote.lua index e24d650..7c763af 100644 --- a/milo/MiloRemote.lua +++ b/milo/MiloRemote.lua @@ -146,8 +146,14 @@ function page:sendRequest(data) self:setStatus('connecting ...') socket, msg = Socket.connect(options.server.value, 4242) if socket then - self:setStatus('connected ...') socket:write(options.user.value) + local r = socket:read(2) + if r and not r.msg then + self:setStatus('connected ...') + else + socket = nil + self:setStatus(r.msg) + end end end if socket then diff --git a/milo/core/machines.lua b/milo/core/machines.lua index 1ba57ff..144cf31 100644 --- a/milo/core/machines.lua +++ b/milo/core/machines.lua @@ -36,9 +36,10 @@ local machinesPage = UI.Page { y = 2, ey = -2, values = context.config.remoteDefaults, columns = { - { key = 'priority', width = 3 }, - { heading = 'Name', key = 'displayName' }, - { heading = 'Type', key = 'mtype', width = 5 }, + { key = 'suffix', width = 4, justify = 'right' }, + { heading = 'Name', key = 'displayName' }, + { heading = 'Type', key = 'mtype', width = 4 }, + { heading = 'Pri', key = 'priority', width = 3 }, }, sortColumn = 'displayName', help = 'Select Machine', @@ -57,6 +58,11 @@ local machinesPage = UI.Page { function machinesPage.grid:getDisplayValues(row) row = Util.shallowCopy(row) + local t = { row.name:match(':(.+)_(%d+)') } + if t and #t == 2 then + row.name, row.suffix = table.unpack(t) + row.name = row.name .. '_' .. row.suffix + end row.displayName = row.displayName or row.name return row end diff --git a/milo/plugins/remote.lua b/milo/plugins/remote.lua index 956e198..ead9956 100644 --- a/milo/plugins/remote.lua +++ b/milo/plugins/remote.lua @@ -29,9 +29,16 @@ local function client(socket) local manipulator = getManipulatorForUser(user) if not manipulator then + socket:write({ + msg = 'Manipulator not found' + }) return end + socket:write({ + data = 'ok', + }) + repeat local data = socket:read() if not data then