Module:Recipes

util_args = require('Module:ProcessArgs') local p = {}

local craftingStations = { ["Fiberworking Station"] = 1, ["Advanced Fiberworking Station"] = 2, ["Furnace"] = 1, ["Advanced Furnace"] = 2, ["Purification Station"] = 1, ["Camp Fire"] = 1, ["Woodworking Station"] = 1, ["Advanced Woodworking Station"] = 2, ["Artificer Woodworking Station"] = 3, ["Ancient Fabricator"] = 1, ["Inventory"] = 1, ["Soil Excavator"] = 1, ["Stomping Station"] = 1, ["Building"] = 1, }

function p.lowestCrafting( frame ) local args = util_args.merge(true) local machineList = args.machineList assert(machineList and machineList ~= "", "No machine list input") local sep = args.sep or "," local lowest for machine in string.gmatch(machineList, "([^"..sep.."]+)") do       local machineValue = craftingStations[machine] if machineValue ~= nil then if not lowest or machineValue < craftingStations[lowest] then lowest = machine end end end assert(lowest, "No valid output") return lowest end

return p