<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AInventory</id>
	<title>Module:Inventory - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AInventory"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Inventory&amp;action=history"/>
	<updated>2026-05-01T04:53:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Inventory&amp;diff=11712&amp;oldid=prev</id>
		<title>Eq: Created page with &quot;-- &lt;pre&gt; local p = {}  local hasc = require(&#039;Module:Paramtest&#039;).has_content  function formatAmount(_x)     local x = tonumber(_x) or 1     if x &lt; 100000 then         return x, &#039;qty-1&#039;     elseif x &lt; 10000000 then         return tostring(math.floor(x/1000))..&#039;K&#039;, &#039;qty-100k&#039;     else         return tostring(math.floor(x/1000000))..&#039;M&#039;, &#039;qty-10m&#039;     end end  function p.main(frame)     local bgType = frame.args.bgType     if bgType == nil then         bgType = &quot;inventory&quot;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Inventory&amp;diff=11712&amp;oldid=prev"/>
		<updated>2024-10-14T04:03:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;pre&amp;gt; local p = {}  local hasc = require(&amp;#039;Module:Paramtest&amp;#039;).has_content  function formatAmount(_x)     local x = tonumber(_x) or 1     if x &amp;lt; 100000 then         return x, &amp;#039;qty-1&amp;#039;     elseif x &amp;lt; 10000000 then         return tostring(math.floor(x/1000))..&amp;#039;K&amp;#039;, &amp;#039;qty-100k&amp;#039;     else         return tostring(math.floor(x/1000000))..&amp;#039;M&amp;#039;, &amp;#039;qty-10m&amp;#039;     end end  function p.main(frame)     local bgType = frame.args.bgType     if bgType == nil then         bgType = &amp;quot;inventory&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;pre&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local hasc = require(&amp;#039;Module:Paramtest&amp;#039;).has_content&lt;br /&gt;
&lt;br /&gt;
function formatAmount(_x)&lt;br /&gt;
    local x = tonumber(_x) or 1&lt;br /&gt;
    if x &amp;lt; 100000 then&lt;br /&gt;
        return x, &amp;#039;qty-1&amp;#039;&lt;br /&gt;
    elseif x &amp;lt; 10000000 then&lt;br /&gt;
        return tostring(math.floor(x/1000))..&amp;#039;K&amp;#039;, &amp;#039;qty-100k&amp;#039;&lt;br /&gt;
    else&lt;br /&gt;
        return tostring(math.floor(x/1000000))..&amp;#039;M&amp;#039;, &amp;#039;qty-10m&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local bgType = frame.args.bgType&lt;br /&gt;
    if bgType == nil then&lt;br /&gt;
        bgType = &amp;quot;inventory&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    local args = frame:getParent().args&lt;br /&gt;
    local items = {}&lt;br /&gt;
    for i=1,28 do&lt;br /&gt;
        local v = mw.text.trim(args[i] or &amp;#039;&amp;#039;)&lt;br /&gt;
        local item_x&lt;br /&gt;
        local link_x&lt;br /&gt;
        local amt_x = 1&lt;br /&gt;
        local note_x = false&lt;br /&gt;
        if hasc(v) then&lt;br /&gt;
            v = v:gsub(&amp;#039;[][]&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
            amt_x = tonumber(v:match(&amp;#039;\\(%d+)&amp;#039;)) or 1&lt;br /&gt;
            note_x = v:match(&amp;#039;;n&amp;#039;) == &amp;#039;;n&amp;#039;&lt;br /&gt;
            local v2 = mw.text.split(v,&amp;#039;[;\\]&amp;#039;)&lt;br /&gt;
            item_x = v2[1]&lt;br /&gt;
            link_x = v2[2] or item_x&lt;br /&gt;
            if link_x == &amp;quot;n&amp;quot; or tonumber(link_x) then&lt;br /&gt;
            	link_x = item_x&lt;br /&gt;
        	end&lt;br /&gt;
        end&lt;br /&gt;
        table.insert(items,{item=item_x,link=link_x,amt=amt_x,isnoted=note_x})&lt;br /&gt;
    end&lt;br /&gt;
    local align = args.align&lt;br /&gt;
    local acss&lt;br /&gt;
    if hasc(align) then&lt;br /&gt;
        align = align:lower()&lt;br /&gt;
        if align == &amp;#039;right&amp;#039; then&lt;br /&gt;
            align = &amp;quot;storage-right&amp;quot;&lt;br /&gt;
        elseif align == &amp;#039;left&amp;#039; then&lt;br /&gt;
            align = &amp;quot;storage-left&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            align = &amp;quot;storage-center&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return p._main(items,align,bgType)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(items,align,bgType)&lt;br /&gt;
    local className = bgType .. &amp;quot;table&amp;quot;&lt;br /&gt;
    local ret = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
        :addClass(className)&lt;br /&gt;
        :addClass(align)&lt;br /&gt;
    local item = 0&lt;br /&gt;
    for i=1,7 do&lt;br /&gt;
        local ret_row = ret:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
        for j=1,4 do&lt;br /&gt;
            item = item + 1&lt;br /&gt;
            local itemx = items[item].item&lt;br /&gt;
            local linkx = items[item].link&lt;br /&gt;
            local amtx = items[item].amt&lt;br /&gt;
            local amtx_f, amtx_c = formatAmount(amtx)&lt;br /&gt;
            local notex = items[item].isnoted&lt;br /&gt;
            local td = ret_row:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
            if hasc(itemx) then&lt;br /&gt;
                td:wikitext(string.format(&amp;#039;[[File:%s.png|link=%s|32x32px|frameless]]&amp;#039;, itemx, linkx))&lt;br /&gt;
                if notex then&lt;br /&gt;
                    td:addClass(&amp;#039;noted-item&amp;#039;)&lt;br /&gt;
                end&lt;br /&gt;
                if amtx &amp;gt; 1 or notex then&lt;br /&gt;
                    td:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
                      :addClass(&amp;#039;inv-quantity-text&amp;#039;)&lt;br /&gt;
                      :addClass(amtx_c)&lt;br /&gt;
                      :wikitext(amtx_f)&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Eq</name></author>
	</entry>
</feed>