Модуль:Prototypes/Роль/Лодаут: различия между версиями

мНет описания правки
мНет описания правки
Строка 5: Строка 5:
local gearloadout      = mw.loadData("Модуль:IanComradeBot/loadout.json/data")
local gearloadout      = mw.loadData("Модуль:IanComradeBot/loadout.json/data")


function p.getEquipment(frame)
function p.main(frame)
local args = frame.args
local args = frame.args
local searchKey = args[1]
local searchKey = args[1]
local roleId = args[2]
local roleParam = args[2]
if not roleId then
if not roleParam then
return '<div class="role">Параметр roleId не указан</div>'
return '<div class="role">Параметр roleId не указан</div>'
end
end
local roleId = "Job" .. roleParam
local results = {}
local results = {}
local role = nil
local role = nil
Строка 21: Строка 22:
end
end
if not role then
if not role then
return '<div class="role">Роль с id "' .. tostring(roleId) .. '" не найдена</div>'
return '<div class="role">Роль с id "' .. roleId .. '" не найдена</div>'
end
end
for _, groupId in ipairs(role.groups or {}) do
for _, groupId in ipairs(role.groups or {}) do