MechWipf

Task Manager config

Aug 1st, 2026
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. local getName = peripheral.getName
  2. local find = peripheral.find
  3. local getType = peripheral.getType
  4.  
  5. local function contains(tbl, item)
  6.   for _, v in pairs(tbl) do
  7.     if v == item then
  8.       return true
  9.     end
  10.   end
  11.  
  12.   return false
  13. end
  14.  
  15. local conf = {}
  16.  
  17. conf.tasks = {
  18.   smelter = {
  19.     {
  20.       id = "smelter",
  21.       drain = getName(find("productivemetalworks:foundry_drain")),
  22.       casting_ingot = (function()
  23.         local p = { find("productivemetalworks:casting") }
  24.         local list = {}
  25.         for _, v in pairs(p) do
  26.           list[#list + 1] = getName(v)
  27.         end
  28.         return list
  29.       end)(),
  30.       fluid_cache = (function()
  31.         local function filter(_, wrapped)
  32.           local types = { getType(wrapped) }
  33.           return
  34.               not (contains(types, "productivemetalworks:foundry_drain")
  35.                 or contains(types, "productivemetalworks:casting"))
  36.         end
  37.  
  38.         local p = { find("fluid_storage", filter) }
  39.         local list = {}
  40.         for _, v in pairs(p) do
  41.           list[#list + 1] = getName(v)
  42.         end
  43.         return list
  44.       end)()
  45.     }
  46.   },
  47.   smelter_monitor = {
  48.     {
  49.       id = "smelter_monitor",
  50.       smelter_id = "smelter",
  51.       monitor = getName(find("monitor")),
  52.       ["monitor.textScale"] = 0.5
  53.     }
  54.   }
  55. }
  56.  
  57. return conf
  58.  
Advertisement
Add Comment
Please, Sign In to add comment