Module:Move7: Difference between revisions

From Wavu Wiki, the 🌊 wavy Tekken wiki
No edit summary
No edit summary
Line 13: Line 13:
local root = mw.html.create('div')
local root = mw.html.create('div')
for row in cargo.query(tables, p.fields, { where = "id = '" .. id .. "'" }) do
for rowName, row in pairs(cargo.query(tables, p.fields, { where = "id = '" .. id .. "'" })) do
local rowNode = mw.html.create('div'):wikitext('row: ' .. rowName)
root:node(rowNode)
for k, v in pairs(row) do
for k, v in pairs(row) do
root:node(mw.html.create('div'):wikitext(k .. ": " .. v))
rowNode:node(mw.html.create('div'):wikitext(k .. ": " .. v))
end
end
end
end

Revision as of 22:56, 21 August 2023

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

local p = {};
local cargo = mw.ext.cargo
local tables = 'MoveDataCargoTest'

p.fields = 'id,input,target,damage,startup'

p.queryOverride = function(frame)
	local args = frame:getParent().args
	local id = args['id']
	if id == nil then
		return "Error: no id"
	end
	
	local root = mw.html.create('div')
	for rowName, row in pairs(cargo.query(tables, p.fields, { where = "id = '" .. id .. "'" })) do
		local rowNode = mw.html.create('div'):wikitext('row: ' .. rowName)
		root:node(rowNode)
		for k, v in pairs(row) do
			rowNode:node(mw.html.create('div'):wikitext(k .. ": " .. v))
		end
	end
	
	return root
end

return p