spaces->tab, equipper improvements, supertreefarm rewrite, follow improvements, sensor cleanup, milo multiple items allowed in recipes, remote canvas access

This commit is contained in:
kepler155c@gmail.com
2019-06-18 15:23:20 -04:00
parent 3b9b509429
commit 045b32884f
162 changed files with 20448 additions and 20286 deletions

View File

@@ -13,48 +13,48 @@ local turtle = _G.turtle
local STARTUP_FILE = 'usr/autorun/enderchest.lua'
local enderChest = device.manipulator and
device.manipulator.getEnder or
error('Must be connected to a manipulator with a bound introspection module')
device.manipulator.getEnder or
error('Must be connected to a manipulator with a bound introspection module')
if not fs.exists(STARTUP_FILE) then
Util.writeFile(STARTUP_FILE,
[[os.sleep(1)
Util.writeFile(STARTUP_FILE,
[[os.sleep(1)
shell.openForegroundTab('packages/milo/apps/enderchest')]])
end
local directions = Util.transpose {
'north', 'south', 'east', 'west', 'up', 'down'
'north', 'south', 'east', 'west', 'up', 'down'
}
Event.on('turtle_inventory', function()
local s, m = pcall(function()
local direction
local s, m = pcall(function()
local direction
for _, d in pairs(enderChest().getTransferLocations()) do
if directions[d] then
direction = d
break
end
end
for _, d in pairs(enderChest().getTransferLocations()) do
if directions[d] then
direction = d
break
end
end
if not direction then
error('Unable to determine transfer direction')
end
if not direction then
error('Unable to determine transfer direction')
end
turtle.eachFilledSlot(function(s)
print('sending')
enderChest().pullItems(direction, s.index)
end)
end)
if not s and m then
_G.printError(m)
end
print('idle')
turtle.eachFilledSlot(function(s)
print('sending')
enderChest().pullItems(direction, s.index)
end)
end)
if not s and m then
_G.printError(m)
end
print('idle')
end)
Event.onInterval(5, function()
-- for some reason, it keeps stalling ...
os.queueEvent('turtle_inventory')
-- for some reason, it keeps stalling ...
os.queueEvent('turtle_inventory')
end)
os.queueEvent('turtle_inventory')