<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.roatpkz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ARecommend_equipment</id>
	<title>Module:Recommend equipment - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.roatpkz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ARecommend_equipment"/>
	<link rel="alternate" type="text/html" href="https://wiki.roatpkz.com/index.php?title=Module:Recommend_equipment&amp;action=history"/>
	<updated>2026-04-25T15:27:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.roatpkz.com/index.php?title=Module:Recommend_equipment&amp;diff=6037&amp;oldid=prev</id>
		<title>Hefner: Created page with &quot;local p = {}  local paramTest = require(&#039;Module:Paramtest&#039;) local onMain = require(&#039;Module:Mainonly&#039;).on_main local yesNo = require(&#039;Module:Yesno&#039;)  local SlotInfo = { 	{ name = &#039;head&#039;, icon = &#039;Head slot&#039;, txt = &#039;Head&#039;, link = &#039;Head slot table&#039; }, 	{ name = &#039;neck&#039;, icon = &#039;Neck slot&#039;, txt = &#039;Neck&#039;, link = &#039;Neck slot table&#039; }, 	{ name = &#039;cape&#039;, icon = &#039;Cape slot&#039;, txt = &#039;Back&#039;, link = &#039;Cape slot table&#039; }, 	{ name = &#039;body&#039;, icon = &#039;Body slot&#039;, txt = &#039;Body&#039;, link = &#039;Body sl...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.roatpkz.com/index.php?title=Module:Recommend_equipment&amp;diff=6037&amp;oldid=prev"/>
		<updated>2024-04-01T13:04:36Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  local paramTest = require(&amp;#039;Module:Paramtest&amp;#039;) local onMain = require(&amp;#039;Module:Mainonly&amp;#039;).on_main local yesNo = require(&amp;#039;Module:Yesno&amp;#039;)  local SlotInfo = { 	{ name = &amp;#039;head&amp;#039;, icon = &amp;#039;Head slot&amp;#039;, txt = &amp;#039;Head&amp;#039;, link = &amp;#039;Head slot table&amp;#039; }, 	{ name = &amp;#039;neck&amp;#039;, icon = &amp;#039;Neck slot&amp;#039;, txt = &amp;#039;Neck&amp;#039;, link = &amp;#039;Neck slot table&amp;#039; }, 	{ name = &amp;#039;cape&amp;#039;, icon = &amp;#039;Cape slot&amp;#039;, txt = &amp;#039;Back&amp;#039;, link = &amp;#039;Cape slot table&amp;#039; }, 	{ name = &amp;#039;body&amp;#039;, icon = &amp;#039;Body slot&amp;#039;, txt = &amp;#039;Body&amp;#039;, link = &amp;#039;Body sl...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local paramTest = require(&amp;#039;Module:Paramtest&amp;#039;)&lt;br /&gt;
local onMain = require(&amp;#039;Module:Mainonly&amp;#039;).on_main&lt;br /&gt;
local yesNo = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local SlotInfo = {&lt;br /&gt;
	{ name = &amp;#039;head&amp;#039;, icon = &amp;#039;Head slot&amp;#039;, txt = &amp;#039;Head&amp;#039;, link = &amp;#039;Head slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;neck&amp;#039;, icon = &amp;#039;Neck slot&amp;#039;, txt = &amp;#039;Neck&amp;#039;, link = &amp;#039;Neck slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;cape&amp;#039;, icon = &amp;#039;Cape slot&amp;#039;, txt = &amp;#039;Back&amp;#039;, link = &amp;#039;Cape slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;body&amp;#039;, icon = &amp;#039;Body slot&amp;#039;, txt = &amp;#039;Body&amp;#039;, link = &amp;#039;Body slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;legs&amp;#039;, icon = &amp;#039;Legs slot&amp;#039;, txt = &amp;#039;Legs&amp;#039;, link = &amp;#039;Legs slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;weapon&amp;#039;, icon = &amp;#039;Weapon slot&amp;#039;, txt = &amp;#039;Weapon&amp;#039;, link = &amp;#039;Weapon slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;shield&amp;#039;, icon = &amp;#039;Shield slot&amp;#039;, txt = &amp;#039;Shield&amp;#039;, link = &amp;#039;Shield slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;2h&amp;#039;, icon = &amp;#039;2h slot&amp;#039;, txt = &amp;#039;Two-handed weapon&amp;#039;, link = &amp;#039;Two-handed slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;ammo&amp;#039;, icon = &amp;#039;Ammo slot&amp;#039;, txt = &amp;#039;Ammo/Spell&amp;#039;, link = &amp;#039;Ammunition slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;hands&amp;#039;, icon = &amp;#039;Hands slot&amp;#039;, txt = &amp;#039;hands&amp;#039;, link = &amp;#039;Hand slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;feet&amp;#039;, icon = &amp;#039;Feet slot&amp;#039;, txt = &amp;#039;Boots&amp;#039;, link = &amp;#039;Feet slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;ring&amp;#039;, icon = &amp;#039;Ring slot&amp;#039;, txt = &amp;#039;Ring&amp;#039;, link = &amp;#039;Ring slot table&amp;#039; },&lt;br /&gt;
	{ name = &amp;#039;special&amp;#039;, icon = &amp;#039;Special attack orb&amp;#039;, txt = &amp;#039;Special attack&amp;#039;, link = &amp;#039;&amp;#039; },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function buildRow(slot, rowData, largestRowSize)&lt;br /&gt;
	local row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	row:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:&amp;#039; .. slot.icon .. &amp;#039;.png|&amp;#039; .. slot.txt .. &amp;#039;|link=&amp;#039; .. slot.link .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
	for _, cellData in ipairs(rowData) do&lt;br /&gt;
		row:tag(&amp;#039;td&amp;#039;):wikitext(cellData)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If there are any rows that empty compared to other rows fill up the remaining td&amp;#039;s with N/As&lt;br /&gt;
	for i = 1, largestRowSize - #rowData, 1 do&lt;br /&gt;
		row:tag(&amp;#039;td&amp;#039;):addClass(&amp;#039;table-na&amp;#039;):wikitext(&amp;#039;N/A&amp;#039;)	&lt;br /&gt;
	end&lt;br /&gt;
	return row&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	&lt;br /&gt;
	-- Tracking for colspan and N/A cells&lt;br /&gt;
	local largestRowSize = 0&lt;br /&gt;
	-- Intended as a hidden setting, use sparingly&lt;br /&gt;
	local maxRowsPerSlot = paramTest.default_to(args.rows, 5)&lt;br /&gt;
	&lt;br /&gt;
	-- Find the greatest row count&lt;br /&gt;
	for i, slot in ipairs(SlotInfo) do&lt;br /&gt;
		local slotRowSize = 0&lt;br /&gt;
		&lt;br /&gt;
		for i = 1, maxRowsPerSlot, 1 do&lt;br /&gt;
			if(paramTest.has_content(args[slot.name .. i])) then&lt;br /&gt;
				slotRowSize = i&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if(largestRowSize &amp;lt; slotRowSize) then&lt;br /&gt;
			largestRowSize = slotRowSize	&lt;br /&gt;
		end&lt;br /&gt;
		if(largestRowSize == maxRowsPerSlot) then&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local ret = mw.html.create(&amp;#039;table&amp;#039;):addClass(&amp;#039;wikitable sticky-header&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	if(paramTest.has_content(args.style)) then&lt;br /&gt;
		ret:tag(&amp;#039;caption&amp;#039;):wikitext(&amp;#039;Recommended equipment for &amp;#039; .. args.style)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	ret:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Slot&amp;#039;):done()&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;, largestRowSize):wikitext(&amp;#039;Item (most effective → least effective)&amp;#039;):done()&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	local slotInputs = {}&lt;br /&gt;
	for _, slot in ipairs(SlotInfo) do&lt;br /&gt;
		local slotRow = {}&lt;br /&gt;
		for i = 1, maxRowsPerSlot, 1 do&lt;br /&gt;
			local gear = args[slot.name .. i]&lt;br /&gt;
			if(paramTest.has_content(gear)) then&lt;br /&gt;
				table.insert(slotRow, gear)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if(#slotRow &amp;gt; 0) then&lt;br /&gt;
			ret:node(buildRow(slot, slotRow, largestRowSize))&lt;br /&gt;
			slotInputs[slot.name] = slotRow&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local useSmw = yesNo(args.smw or &amp;#039;&amp;#039;, true)&lt;br /&gt;
	if(useSmw and onMain()) then&lt;br /&gt;
		local jsonObject = { [&amp;#039;Recommended Equipment&amp;#039;] = slotInputs, style = args.style}&lt;br /&gt;
		local smwmap = {&lt;br /&gt;
			[&amp;#039;Recommended Equipment JSON&amp;#039;] = mw.text.jsonEncode(jsonObject),&lt;br /&gt;
		}&lt;br /&gt;
		mw.smw.set(smwmap)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args	&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Hefner</name></author>
	</entry>
</feed>