Просмотр кода страницы Модуль:TableOfChemicals
Материал из Space Station 14 Вики
У вас нет прав на выполнение действия «редактирование этой страницы» по следующей причине:
Вы можете просмотреть и скопировать исходный код этой страницы.
p = {}
p.chem = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/chem_prototypes.json"):getContent())
p.react = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/react_prototypes.json"):getContent())
p.fillReactTable = function(frame)
local out = ""
for _, reactPrototype in pairs(p.react) do
if tablelength(reactPrototype.effects) ~= 0 then
local reactants = {}
local reactantTemplate = "%s [[#chem_%s|%s]]"
for reactantId, reactantValue in pairs(reactPrototype.reactants) do
local reactantChemData = p.chem[reactantId]
local reactantText = string.format(reactantTemplate, reactantValue.amount, reactantChemData.id, reactantChemData.name)
if reactantValue.catalyst then
reactantText = reactantText .. " (катализатор)"
end
table.insert(reactants, reactantText)
end
000
1:0
Шаблон, используемый на этой странице:
Возврат к странице Модуль:TableOfChemicals.