Модуль:TableOfChemicals: различия между версиями
Нет описания правки |
Relokant (обсуждение | вклад) м Серная кислота не существует в раздатчике химикатов. Это миф Метки: с мобильного устройства из мобильной версии |
||
| (не показано 5 промежуточных версий 1 участника) | |||
| Строка 1: | Строка 1: | ||
p = {} | p = {} | ||
p.chem = mw.text.jsonDecode(mw.title.new("User: | p.chem = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/chem_prototypes.json"):getContent()) | ||
p.react = mw.text.jsonDecode(mw.title.new("User: | p.react = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/react_prototypes.json"):getContent()) | ||
p.fillReactTable = function(frame) | p.fillReactTable = function(frame) | ||
| Строка 80: | Строка 80: | ||
return out | return out | ||
end | end | ||
p.fillContentOfDispencer = function(frame) | |||
local dispencer = frame.args.dispencer | |||
local out = "" | |||
for _, chemId in pairs(dispencersContent()[dispencer]) do | |||
out = out .. frame:expandTemplate{ title = "Кнопка_реагента", args = {chemId, "y"}} | |||
end | |||
return out | |||
end | |||
function dispencersContent() | |||
local content = { | |||
["Химикатов"]={ | |||
"Aluminium","Carbon","Chlorine","Copper","Ethanol","Fluorine","Hydrogen","Iodine", | |||
"Iron","Lithium","Mercury","Nitrogen","Oxygen","Phosphorus","Potassium","Radium", | |||
"Silicon","Sodium","Sugar","Sulfur" | |||
}, | |||
["Соды"]={ | |||
"Water","Ice","Coffee","Cream","Tea","GreenTea","IcedTea","IcedGreenTea", | |||
"Cola","SpaceMountainWind","DrGibb","SpaceUp","TonicWater","SodaWater","LemonLime","Sugar", | |||
"JuiceOrange","JuiceLime","JuiceWatermelon" | |||
}, | |||
["Алкоголя"]={ | |||
"LemonLime","Sugar","JuiceOrange","JuiceLime","SodaWater","TonicWater","Beer","CoffeeLiqueur", | |||
"Whiskey","Wine","Vodka","Gin","Rum","Tequila","Vermouth","Cognac", | |||
"Ale","Mead" | |||
} | |||
} | |||
return content | |||
end | |||
p.readArg = function(frame) | |||
return mw.text.nowiki(p.chem[frame.args[1]][frame.args[2]]) | |||
end | |||
function contains(list, x) | function contains(list, x) | ||