milo wip
This commit is contained in:
@@ -4,7 +4,6 @@ local itemDB = require('itemDB')
|
||||
local Util = require('util')
|
||||
|
||||
local os = _G.os
|
||||
local term = _G.term
|
||||
local turtle = _G.turtle
|
||||
|
||||
local Milo = {
|
||||
@@ -81,12 +80,7 @@ function Milo:registerTask(task)
|
||||
end
|
||||
|
||||
function Milo:showError(msg)
|
||||
--term.clear()
|
||||
self.context.jobList:showError(msg)
|
||||
--print(msg)
|
||||
--print('rebooting in 5 secs')
|
||||
--os.sleep(5)
|
||||
--os.reboot()
|
||||
end
|
||||
|
||||
function Milo:getItem(items, inItem, ignoreDamage, ignoreNbtHash)
|
||||
|
||||
@@ -118,9 +118,11 @@ function NetworkedAdapter:provide(item, qty, slot, direction)
|
||||
local total = 0
|
||||
|
||||
for _, remote in ipairs(self.remotes) do
|
||||
debug('%s -> slot %d: %d %s', remote.side, slot or -1, qty, item.name)
|
||||
local amount = remote:provide(item, qty, slot, direction)
|
||||
if amount > 0 then
|
||||
debug('%s(%d): %s -> %s%s',
|
||||
item.name, amount, remote.side, direction or self.localName,
|
||||
slot and string.format('[%d]', slot) or '')
|
||||
self.dirty = true
|
||||
remote.dirty = true
|
||||
local entry = self.activity[key] or 0
|
||||
@@ -170,7 +172,9 @@ function NetworkedAdapter:insert(slot, qty, toSlot, item, source)
|
||||
local function insert(remote)
|
||||
local amount = remote:insert(slot, qty, toSlot, source or self.direction)
|
||||
if amount > 0 then
|
||||
debug('%s(%d) -> %s: %d', source or self.localName, slot, remote.side, amount)
|
||||
debug('%s(%d): %s[%d] -> %s',
|
||||
item.name, amount,
|
||||
source or self.localName, slot, remote.side)
|
||||
self.dirty = true
|
||||
remote.dirty = true
|
||||
local entry = self.activity[key] or 0
|
||||
|
||||
Reference in New Issue
Block a user