oops
This commit is contained in:
32
ignore/drops.lua
Normal file
32
ignore/drops.lua
Normal file
@@ -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
|
||||||
@@ -180,7 +180,7 @@ local function createPage(node)
|
|||||||
if n.adapter.size and n.adapter.list then
|
if n.adapter.size and n.adapter.list then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
local updated = n.adapter.__lastUpdate ~= n.adapter.lastUpdate
|
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.__used = Util.size(n.adapter.list())
|
||||||
n.adapter.__lastUpdate = n.adapter.lastUpdate
|
n.adapter.__lastUpdate = n.adapter.lastUpdate
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if not turtle.select('minecraft:bucket') then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local s, m = turtle.run(function()
|
local s, m = turtle.run(function()
|
||||||
turtle.set({ 'status', 'refueling' })
|
turtle.set({ status = 'refueling' })
|
||||||
turtle.setMovementStrategy('goto')
|
turtle.setMovementStrategy('goto')
|
||||||
|
|
||||||
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
||||||
@@ -59,7 +59,7 @@ end)
|
|||||||
turtle.gotoY(0)
|
turtle.gotoY(0)
|
||||||
turtle.go({ x = 0, y = 0, z = 0 })
|
turtle.go({ x = 0, y = 0, z = 0 })
|
||||||
|
|
||||||
turtle.set({ 'status', 'idle' })
|
turtle.set({ status = 'idle' })
|
||||||
turtle.unequip('left')
|
turtle.unequip('left')
|
||||||
print('Fuel: ' .. turtle.getFuelLevel())
|
print('Fuel: ' .. turtle.getFuelLevel())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user