This commit is contained in:
kepler155c
2018-10-28 20:36:40 -04:00
parent 1c70085450
commit ca22b49aaf
7 changed files with 121 additions and 37 deletions

View File

@@ -59,17 +59,20 @@ debug('remote: ' .. data.request)
Milo:clearGrid()
elseif data.request == 'transfer' then
local count = context.storage:export(
context.localName,
nil,
data.count,
data.item)
turtle.eachFilledSlot(function(slot)
manipulator.getInventory().pullItems(
local count = Milo:provideItem(data.item, data.count, function(amount, currentCount)
amount = context.storage:export(
context.localName,
slot.index,
slot.count)
nil,
amount,
data.item)
turtle.eachFilledSlot(function(slot)
manipulator.getInventory().pullItems(
context.localName,
slot.index,
slot.count)
end)
return currentCount - amount
end)
socket:write({ count = count })