Compare commits
2 commits
c9e50405aa
...
04f6d66e56
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04f6d66e56 | ||
|
|
528d5f7f80 |
1 changed files with 45 additions and 4 deletions
|
|
@ -24,6 +24,10 @@ local KEEP_STOCKED = {
|
||||||
["minecraft:gravel"] = 0,
|
["minecraft:gravel"] = 0,
|
||||||
["minecraft:netherite_scrap"] = 4,
|
["minecraft:netherite_scrap"] = 4,
|
||||||
["minecraft:nether_bricks"] = 0,
|
["minecraft:nether_bricks"] = 0,
|
||||||
|
["oreganized:silver_nugget"] = 4 * 64,
|
||||||
|
["tfmg:nickel_nugget"] = 4 * 64,
|
||||||
|
["tfmg:lithium_nugget"] = 64,
|
||||||
|
["tfmg:bauxite_powder"] = 4 * 64,
|
||||||
}
|
}
|
||||||
|
|
||||||
local GLOBAL_LIMS = {
|
local GLOBAL_LIMS = {
|
||||||
|
|
@ -44,6 +48,10 @@ local LIMIT_EXCEPTIONS = {
|
||||||
lower = 0,
|
lower = 0,
|
||||||
upper = 4,
|
upper = 4,
|
||||||
},
|
},
|
||||||
|
["tfmg:lithium_nugget"] = {
|
||||||
|
lower = -1,
|
||||||
|
upper = 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- if these exist, they will be used up
|
-- if these exist, they will be used up
|
||||||
|
|
@ -61,6 +69,11 @@ local PRODUCTS = {
|
||||||
{"minecraft:brick", HAUNTER_ADDR},
|
{"minecraft:brick", HAUNTER_ADDR},
|
||||||
{"minecraft:flint", CRUSHER_ADDR},
|
{"minecraft:flint", CRUSHER_ADDR},
|
||||||
{"minecraft:nether_bricks", CRUSHER_ADDR},
|
{"minecraft:nether_bricks", CRUSHER_ADDR},
|
||||||
|
{"minecraft:basalt", CRUSHER_ADDR},
|
||||||
|
{"create:crushed_raw_silver", WASHER_ADDR},
|
||||||
|
{"minecraft:calcite", CRUSHER_ADDR},
|
||||||
|
{"create:crushed_raw_nickel", WASHER_ADDR},
|
||||||
|
{"tfmg:bauxite", CRUSHER_ADDR},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- these will be crafted when needed
|
-- these will be crafted when needed
|
||||||
|
|
@ -126,6 +139,27 @@ local RECIPES = {
|
||||||
},
|
},
|
||||||
addr = PRESS_ADDR,
|
addr = PRESS_ADDR,
|
||||||
},
|
},
|
||||||
|
["oreganized:silver_nugget"] = {
|
||||||
|
ingredients = {
|
||||||
|
{"oreganized:silver_nugget", 60},
|
||||||
|
{"minecraft:gravel", 24},
|
||||||
|
},
|
||||||
|
addr = PRESS_ADDR,
|
||||||
|
},
|
||||||
|
["tfmg:nickel_nugget"] = {
|
||||||
|
ingredients = {
|
||||||
|
{"tfmg:nickel_nugget", 64},
|
||||||
|
{"minecraft:gravel", 64},
|
||||||
|
},
|
||||||
|
addr = PRESS_ADDR,
|
||||||
|
},
|
||||||
|
["tfmg:bauxite_powder"] = {
|
||||||
|
ingredients = {
|
||||||
|
{"tfmg:bauxite_powder", 64},
|
||||||
|
{"minecraft:gravel", 64},
|
||||||
|
},
|
||||||
|
addr = PRESS_ADDR,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local SLEEP_T = 20
|
local SLEEP_T = 20
|
||||||
|
|
@ -217,11 +251,19 @@ function getNumCraftable (ingredients, current_stock)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function craftRecipe (ticker, recipe, count)
|
function adjustStock (current_stock, recipe, count)
|
||||||
if count == nil then count = 1 end
|
for _, ingredient in ipairs(recipe.ingredients) do
|
||||||
|
item, i_count = ingredient[1], ingredient[2]
|
||||||
|
current_stock[item] = current_stock[item] - (i_count * count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function craftRecipe (ticker, recipe, current_stock)
|
||||||
|
local count = getNumCraftable(recipe.ingredients, current_stock)
|
||||||
if recipe.limit ~= nil then
|
if recipe.limit ~= nil then
|
||||||
count = math.min(count, recipe.limit)
|
count = math.min(count, recipe.limit)
|
||||||
end
|
end
|
||||||
|
adjustStock(current_stock, recipe, count)
|
||||||
local createRequest
|
local createRequest
|
||||||
createRequest = function (recipe, i)
|
createRequest = function (recipe, i)
|
||||||
if i == nil then i = 1 end
|
if i == nil then i = 1 end
|
||||||
|
|
@ -263,8 +305,7 @@ function run (ticker, export_storage, current_modes)
|
||||||
if mode[1] == "recipe" then
|
if mode[1] == "recipe" then
|
||||||
-- make as many recipes as you can with current stock
|
-- make as many recipes as you can with current stock
|
||||||
local recipe = RECIPES[item]
|
local recipe = RECIPES[item]
|
||||||
local count = getNumCraftable(recipe.ingredients, stock_amounts)
|
craftRecipe(ticker, recipe, stock_amounts)
|
||||||
craftRecipe(ticker, recipe, count)
|
|
||||||
elseif mode[1] == "export" then
|
elseif mode[1] == "export" then
|
||||||
local export_amt = export_amounts[item]
|
local export_amt = export_amounts[item]
|
||||||
if export_amt == nil then export_amt = 0 end
|
if export_amt == nil then export_amt = 0 end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue