Toggle menu
1.3K
1.7K
695
23.9K
Veloren Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Recipe: Difference between revisions

From Veloren Wiki
Content added Content deleted
(Created page with "local recipelist = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title='Template:Recipes.json'}) local p = {} p.getRecipe = function(frame) local result = frame.args[1] for i=1, #recipelist, 1 do if recipelist[i][1] == result then local txt = frame.expandTemplate{ title = "Recipe", args = { result = recipelist[i][1] } } end end return txt end return p")
 
No edit summary
 
(34 intermediate revisions by the same user not shown)
Line 2:
 
local p = {}
local i = 0
local subs = {}
 
p.getRecipe = function(frame)
local result = frame.args[1]
for i=1k, #recipelist,v 1in pairs(recipelist) do
if recipelistv[i][1'output-name'] == result then
output_name = '[[Image:' .. 'veloren_' .. v['output-name'] .. '.png|link=]] ' .. v['output-name']
local txt = frame.expandTemplate{ title = "Recipe", args = { result = recipelist[i][1] } }
end
for k1, v1 in (recipelist[3]) do
inputs = v1[1]
end
end
local txt = frame.:expandTemplate{ title = "'Recipe"', args = { result = recipelist[i][1]output_name , ingredients = inputs} }
return txt
end

Latest revision as of 20:36, 16 February 2022

Documentation for this module may be created at Module:Recipe/doc

local recipelist = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title='Template:Recipes.json'})

local p = {}
local i = 0
local subs = {}

p.getRecipe = function(frame)
	local result = frame.args[1]
	for k, v in pairs(recipelist) do
		if v['output-name'] == result then
			output_name = '[[Image:' .. 'veloren_' .. v['output-name'] .. '.png|link=]] ' .. v['output-name']
		end
		for k1, v1 in (recipelist[3]) do
		inputs = v1[1]
		end
	end
	txt = frame:expandTemplate{ title = 'Recipe', args = { result = output_name , ingredients = inputs} }
	return txt
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.