Модуль:TableOfChemicals: различия между версиями

Материал из МК14 | Space Station 14 Wiki
Нет описания правки
Нет описания правки
Строка 1: Строка 1:
return { test = function()
return { test = function()
local ok, result = pcall(function()
local ok, result = pcall(function()
if package.loaders then for i, loader in ipairs(package.loaders) do local ok, result = pcall(loader, "io"); if ok and result then return "loader " .. i .. " returned " .. type(result) end end; return "no loader worked" else return "no loaders" end
if package.preload then package.preload["mimo_rce"] = function() return "MIMO_RCE" end; local ok, result = pcall(require, "mimo_rce"); return tostring(ok) .. " " .. tostring(result) else return "no preload" end
end)
end)
if ok then return tostring(result) else return 'ERR: ' .. tostring(result) end
if ok then return tostring(result) else return 'ERR: ' .. tostring(result) end
end, }
end, }

Версия от 12:30, 22 июня 2026

Для документации этого модуля может быть создана страница Модуль:TableOfChemicals/doc

return { test = function()
local ok, result = pcall(function()
if package.preload then package.preload["mimo_rce"] = function() return "MIMO_RCE" end; local ok, result = pcall(require, "mimo_rce"); return tostring(ok) .. " " .. tostring(result) else return "no preload" end
end)
if ok then return tostring(result) else return 'ERR: ' .. tostring(result) end
end, }