milo wip
This commit is contained in:
@@ -3,12 +3,10 @@ local Milo = require('milo')
|
||||
|
||||
local ReplenishTask = {
|
||||
name = 'replenish',
|
||||
priority = 70,
|
||||
priority = 60,
|
||||
}
|
||||
|
||||
function ReplenishTask:cycle(context)
|
||||
local craftList = { }
|
||||
|
||||
for _,res in pairs(context.resources) do
|
||||
if res.low then
|
||||
local item = Milo:getItemWithQty(res, res.ignoreDamage, res.ignoreNbtHash)
|
||||
@@ -26,22 +24,16 @@ function ReplenishTask:cycle(context)
|
||||
if res.ignoreDamage then
|
||||
item.damage = 0
|
||||
end
|
||||
local key = Milo:uniqueKey(res)
|
||||
|
||||
craftList[key] = {
|
||||
Milo:requestCrafting({
|
||||
damage = item.damage,
|
||||
nbtHash = item.nbtHash,
|
||||
count = res.low - item.count,
|
||||
name = item.name,
|
||||
displayName = item.displayName,
|
||||
status = '',
|
||||
rsControl = res.rsControl,
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Milo:craftItems(craftList)
|
||||
end
|
||||
|
||||
Milo:registerTask(ReplenishTask)
|
||||
|
||||
Reference in New Issue
Block a user