Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local getName = peripheral.getName
- local find = peripheral.find
- local getType = peripheral.getType
- local function contains(tbl, item)
- for _, v in pairs(tbl) do
- if v == item then
- return true
- end
- end
- return false
- end
- local conf = {}
- conf.tasks = {
- smelter = {
- {
- id = "smelter",
- drain = getName(find("productivemetalworks:foundry_drain")),
- casting_ingot = (function()
- local p = { find("productivemetalworks:casting") }
- local list = {}
- for _, v in pairs(p) do
- list[#list + 1] = getName(v)
- end
- return list
- end)(),
- fluid_cache = (function()
- local function filter(_, wrapped)
- local types = { getType(wrapped) }
- return
- not (contains(types, "productivemetalworks:foundry_drain")
- or contains(types, "productivemetalworks:casting"))
- end
- local p = { find("fluid_storage", filter) }
- local list = {}
- for _, v in pairs(p) do
- list[#list + 1] = getName(v)
- end
- return list
- end)()
- }
- },
- smelter_monitor = {
- {
- id = "smelter_monitor",
- smelter_id = "smelter",
- monitor = getName(find("monitor")),
- ["monitor.textScale"] = 0.5
- }
- }
- }
- return conf
Advertisement
Add Comment
Please, Sign In to add comment