brewing station auto learn
This commit is contained in:
@@ -153,6 +153,20 @@ function Milo:eject(item, qty)
|
||||
end
|
||||
end
|
||||
|
||||
function Milo:saveMachineRecipe(recipe, result, machine)
|
||||
local key = Milo:uniqueKey(result)
|
||||
|
||||
-- save the recipe
|
||||
self.context.userRecipes[key] = recipe
|
||||
Util.writeTable(Milo.RECIPES_FILE, self.context.userRecipes)
|
||||
|
||||
-- save the machine association
|
||||
Craft.machineLookup[key] = machine
|
||||
Util.writeTable(Craft.MACHINE_LOOKUP, Craft.machineLookup)
|
||||
|
||||
Craft.loadRecipes()
|
||||
end
|
||||
|
||||
function Milo:mergeResources(t)
|
||||
for _,v in pairs(self.context.resources) do
|
||||
local item = self:getItem(t, v)
|
||||
|
||||
@@ -218,7 +218,7 @@ function NetworkedAdapter:insert(slot, qty, toSlot, item, source)
|
||||
if amount > 0 then
|
||||
debug('INS: %s(%d): %s[%d] -> %s',
|
||||
item.name, amount,
|
||||
source, slot, adapter.name)
|
||||
source or self.localName, slot, adapter.name)
|
||||
self.dirty = true
|
||||
adapter.dirty = true
|
||||
local entry = self.activity[key] or 0
|
||||
|
||||
Reference in New Issue
Block a user