diff --git a/ignore/drops.lua b/ignore/drops.lua new file mode 100644 index 0000000..7154a13 --- /dev/null +++ b/ignore/drops.lua @@ -0,0 +1,32 @@ +local Point = require('point') +local Util = require('util') + +local device = _G.device +local os = _G.os +local turtle = _G.turtle + +local scanner = device['plethora:scanner'] +local sensor = device['plethora:sensor'] + +turtle.reset() + +local facing = scanner.getBlockMeta(0, 0, 0).state.facing +turtle.point.heading = Point.facings[facing].heading + +while true do + local sensed = Util.reduce(sensor.sense(), function(acc, s) + s.y = Util.round(s.y) + if s.y == -1 then + s.x = Util.round(s.x) + turtle.point.x + s.z = Util.round(s.z) + turtle.point.z + table.insert(acc, s) + end + return acc + end, { }) + + Point.eachClosest(turtle.point, sensed, function(s) + turtle.suckDownAt(s) + end) + + os.sleep(5) +end diff --git a/milo/plugins/statsView.lua b/milo/plugins/statsView.lua index 73fb157..8300ba6 100644 --- a/milo/plugins/statsView.lua +++ b/milo/plugins/statsView.lua @@ -180,7 +180,7 @@ local function createPage(node) if n.adapter.size and n.adapter.list then pcall(function() local updated = n.adapter.__lastUpdate ~= n.adapter.lastUpdate - if n.adapter.__lastUpdate ~= n.adapter.lastUpdate then + if updated then n.adapter.__used = Util.size(n.adapter.list()) n.adapter.__lastUpdate = n.adapter.lastUpdate end diff --git a/turtle/lavaRefuel.lua b/turtle/lavaRefuel.lua index e3b19c3..3c562eb 100644 --- a/turtle/lavaRefuel.lua +++ b/turtle/lavaRefuel.lua @@ -22,7 +22,7 @@ if not turtle.select('minecraft:bucket') then end local s, m = turtle.run(function() - turtle.set({ 'status', 'refueling' }) + turtle.set({ status = 'refueling' }) turtle.setMovementStrategy('goto') local facing = scanner.getBlockMeta(0, 0, 0).state.facing @@ -59,7 +59,7 @@ end) turtle.gotoY(0) turtle.go({ x = 0, y = 0, z = 0 }) -turtle.set({ 'status', 'idle' }) +turtle.set({ status = 'idle' }) turtle.unequip('left') print('Fuel: ' .. turtle.getFuelLevel())