Module:Sandbox/CX Zoom/WPBS 2

local A = {}

function A.main( frame ) local content = frame.args[1] local class = frame.args["class"] local temps = {} local name = {} local i = 1 local params = {} local params_x = {} local params_y = {} local Y = {} local oldClass = {} for t in string.gmatch(content, "(.-)###") do		temps[i] = mw.text.trim(t) params[i] = {} params_x[i] = {} params_y[i] = {} Y[i] = {} local j = 0 for p in string.gmatch(temps[i], "([^&&&]-)&&&") do			params[i][j] = mw.text.trim(p) if j ~= 0 then params_x[i][j], params_y[i][j] = string.match(params[i][j], "(.*)===(.*)") if params_y[i][j] ~= "000" then Y[i][params_x[i][j]] = params_y[i][j] end end j = j + 1 end if (Y[i]["class"] == nil) or (Y[i]["class"] == "") then Y[i]["class"] = class else oldClass[i] = Y[i]["class"] end m, n = string.match(params[i][0], "(.*)@@@(.*)") name[i] = mw.text.trim(n) if i == 1 then store = frame:expandTemplate{ title = name[i], args = Y[i] } else store = store .. frame:expandTemplate{ title = name[i], args = Y[i] } end i = i + 1 end --[=[	for k, v in pairs( oldClass ) do		if v ~= nil then oldClassCat = "" break else oldClassCat = "" end end local c = i	while c > 2 do		if oldClass[c-1] ~= oldClass[c-2] then oldClassCat = oldClassCat .. ""			c = 0 else oldClassCat = oldClassCat .. ""			c = c - 1 end end if (class == nil) or (class == "") then oldClassCat = oldClassCat .. ""	else local d = i		while d > 1 do			if oldClass[d-1] ~= class then oldClassCat = oldClassCat .. ""				d = 0 else oldClassCat = oldClassCat .. ""				d = d - 1 end end end ]=]

local output = store --.. oldClassCat return output end

return A