Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 159: Строка 159:


     if #filteredStorages == 0 then
     if #filteredStorages == 0 then
         return "Хранилище, содержащее предмет с id " .. targetId .. ", не найдено."
         return ""
     end
     end


     return "Найденные хранилища: " .. table.concat(filteredStorages, ", ")
local filteredStoragesLinks = {}
for _, storage in ipairs(filteredStorages) do
    table.insert(filteredStoragesLinks, "[[{{#invoke:Entity Lookup|getname|" .. storage .. "}}|{{#invoke:Entity Lookup|getname|" .. storage .. "}}]]")
end
 
     return "Находится хранилище: " .. table.concat(filteredStorages, ", ")
end
end


Строка 189: Строка 194:
                     end
                     end
                     if foundJob then
                     if foundJob then
                         table.insert(results, "Job: " .. foundJob .. " (слот: " .. slot .. ")")
                         table.insert(results, "{{ucfirst:{{#invoke:Ftl|main|translation|" .. foundJob .. "}}}}")
                     end
                     end
                 end
                 end
Строка 230: Строка 235:
                     end
                     end
                     if foundJob then
                     if foundJob then
                         table.insert(results, "Job: " .. foundJob .. " (слот: " .. slot .. ")")
                         table.insert(results, "{{ucfirst:{{#invoke:Ftl|main|translation|" .. foundJob .. "}}}}")
                     end
                     end
                 end
                 end
Строка 241: Строка 246:
     end
     end


     return "Найдено использование оборудования: " .. table.concat(results, "; ")
     return "Начальная экипировка роли: " .. table.concat(results, ", ")
end
end


Строка 277: Строка 282:


     if #cargoStorages == 0 then
     if #cargoStorages == 0 then
         return "Хранилище, содержащее предмет с id " .. searchValue .. ", не найдено."
         return ""
     end
     end
      
      
Строка 332: Строка 337:


     if #matchingLathes == 0 then
     if #matchingLathes == 0 then
         return "Станок, производящий '" .. targetResult .. "', не найден."
         return ""
     end
     end


     return "Найденные станки: " .. table.concat(matchingLathes, ", ")
local matchingLathesLinks = {}
for _, storage in ipairs(matchingLathes) do
    table.insert(matchingLathesLinks, "[[{{#invoke:Entity Lookup|getname|" .. storage .. "}}|{{#invoke:Entity Lookup|getname|" .. storage .. "}}]]")
end
 
     return "Может быть напечатано на станке: " .. table.concat(matchingLathesLinks, ", ")
end
end


Строка 373: Строка 383:


     if #matchingInventoryIds == 0 then
     if #matchingInventoryIds == 0 then
         return "Предмет с id " .. targetId .. " не найден ни в одном инвентаре."
         return ""
     end
     end


Строка 392: Строка 402:


     if #matchingVendingMachines == 0 then
     if #matchingVendingMachines == 0 then
         return "Не найден торговый автомат, содержащий предмет с id " .. targetId .. "."
         return ""
     end
     end
   
    local matchingVendingMachinesLinks = {}
for _, storage in ipairs(matchingVendingMachines) do
    table.insert(matchingVendingMachinesLinks, "[[{#invoke:Entity Lookup|getname|" .. storage .. "}}|{{#invoke:Entity Lookup|getname|" .. storage .. "}}]]")
end


     return "Торговые автоматы, содержащие предмет " .. targetId .. ": " .. table.concat(matchingVendingMachines, ", ")
     return "Содержится в торгомате: " .. table.concat(matchingVendingMachines, ", ")
end
end