<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://2012wiki.werdegames.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACube_recipe</id>
	<title>Module:Cube recipe - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://2012wiki.werdegames.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACube_recipe"/>
	<link rel="alternate" type="text/html" href="https://2012wiki.werdegames.com/index.php?title=Module:Cube_recipe&amp;action=history"/>
	<updated>2026-11-06T14:06:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://2012wiki.werdegames.com/index.php?title=Module:Cube_recipe&amp;diff=1330&amp;oldid=prev</id>
		<title>Admin: tools/wiki/push.py</title>
		<link rel="alternate" type="text/html" href="https://2012wiki.werdegames.com/index.php?title=Module:Cube_recipe&amp;diff=1330&amp;oldid=prev"/>
		<updated>2026-11-06T03:07:31Z</updated>

		<summary type="html">&lt;p&gt;tools/wiki/push.py&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- A table line of the Horadric Cube page (Template:Cube recipe) and its row in the Cargo table CubeRecipes.&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function lines(text)&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for line in mw.text.gsplit(text or &amp;#039;&amp;#039;, &amp;#039;\n&amp;#039;, true) do&lt;br /&gt;
		line = mw.text.trim(line)&lt;br /&gt;
		if line ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			table.insert(out, line)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- &amp;quot;+[10-20] to Strength&amp;quot;: the rolled range gets its own colour, as in Template:Item&lt;br /&gt;
local function stat_line(line)&lt;br /&gt;
	return (line:gsub(&amp;#039;%[(%-?%d+%-%-?%d+)%]&amp;#039;, &amp;#039;&amp;lt;span class=&amp;quot;d2-range&amp;quot;&amp;gt;[%1]&amp;lt;/span&amp;gt;&amp;#039;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- the output cell: an item per line, its modifiers on the lines below it that start with &amp;quot;:&amp;quot;&lt;br /&gt;
local function output(text)&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for _, line in ipairs(lines(text)) do&lt;br /&gt;
		if line:sub(1, 1) == &amp;#039;:&amp;#039; then&lt;br /&gt;
			table.insert(out, &amp;#039;&amp;lt;div class=&amp;quot;cube-mod&amp;quot;&amp;gt;&amp;#039; .. stat_line(mw.text.trim(line:sub(2))) .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			table.insert(out, &amp;#039;&amp;lt;div class=&amp;quot;cube-item&amp;quot;&amp;gt;&amp;#039; .. line .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(out)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- the item names of the inputs for queries: &amp;quot;2 x Arcane Crystal&amp;quot; -&amp;gt; &amp;quot;Arcane Crystal&amp;quot;, &amp;quot;any Weapon (unique)&amp;quot; -&amp;gt; &amp;quot;any Weapon&amp;quot;&lt;br /&gt;
local function names(text)&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for _, line in ipairs(lines(text)) do&lt;br /&gt;
		line = line:gsub(&amp;#039;^%d+ x &amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039; %([^()]*%)$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
		table.insert(out, (line:gsub(&amp;#039;;&amp;#039;, &amp;#039;,&amp;#039;)))&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(out, &amp;#039;;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.row(frame)&lt;br /&gt;
	local a = frame:getParent().args&lt;br /&gt;
	local inputs = table.concat(lines(a.inputs), &amp;#039;&amp;lt;br&amp;gt;&amp;#039;)&lt;br /&gt;
	local out = output(a.output)&lt;br /&gt;
	local notes = a.notes or &amp;#039;&amp;#039;&lt;br /&gt;
	local cells = {&lt;br /&gt;
		&amp;#039;|-&amp;#039;,&lt;br /&gt;
		&amp;#039;| &amp;#039; .. (a.recipe or &amp;#039;&amp;#039;),&lt;br /&gt;
		&amp;#039;| &amp;#039; .. inputs,&lt;br /&gt;
		&amp;#039;| &amp;#039; .. out,&lt;br /&gt;
		&amp;#039;| &amp;#039; .. notes,&lt;br /&gt;
		&amp;#039;| &amp;lt;span class=&amp;quot;cube-rows&amp;quot;&amp;gt;&amp;#039; .. (a.rows or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;,&lt;br /&gt;
	}&lt;br /&gt;
	local text = table.concat(cells, &amp;#039;\n&amp;#039;)&lt;br /&gt;
	if mw.title.getCurrentTitle().namespace == 0 and (a.store or &amp;#039;&amp;#039;) == &amp;#039;&amp;#039; then&lt;br /&gt;
		frame:callParserFunction(&amp;#039;#cargo_store:&amp;#039;, {&lt;br /&gt;
			_table = &amp;#039;CubeRecipes&amp;#039;,&lt;br /&gt;
			section = a.section or &amp;#039;&amp;#039;,&lt;br /&gt;
			recipe = a.recipe or &amp;#039;&amp;#039;,&lt;br /&gt;
			inputs = inputs,&lt;br /&gt;
			items = names(a.inputs),&lt;br /&gt;
			output = out,&lt;br /&gt;
			notes = notes,&lt;br /&gt;
			rows = a.rows or &amp;#039;&amp;#039;,&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
	return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>