<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.perfecttower2.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AFactory_slot%2Fdoc</id>
	<title>Module:Factory slot/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.perfecttower2.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AFactory_slot%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.perfecttower2.com/w/index.php?title=Module:Factory_slot/doc&amp;action=history"/>
	<updated>2026-10-07T13:03:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.perfecttower2.com/w/index.php?title=Module:Factory_slot/doc&amp;diff=4325&amp;oldid=prev</id>
		<title>Speedybrain: Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.perfecttower2.com/w/index.php?title=Module:Factory_slot/doc&amp;diff=4325&amp;oldid=prev"/>
		<updated>2026-10-07T01:41:27Z</updated>

		<summary type="html">&lt;p&gt;Documentation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Draws one slot of a [[Factory]] grid: an item icon with its stack count. [[Module:UI]] uses it for the crafting grids of [[Template:Crafting|&amp;lt;nowiki&amp;gt;{{Crafting}}&amp;lt;/nowiki&amp;gt;]], and [[Module:Recipe table]] uses its stack parser. Inspired by and partially based on [https://minecraft.wiki/w/Module:Inventory_slot Minecraft Wiki&amp;#039;s Module:Inventory slot].&lt;br /&gt;
&lt;br /&gt;
The look is in [[Template:Crafting/styles.css]] (TemplateStyles). &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; adds that stylesheet; when a module calls &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt;, the module adds it, as [[Module:UI]] does.&lt;br /&gt;
&lt;br /&gt;
== Item stacks ==&lt;br /&gt;
A stack is written &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Name,count&amp;lt;/code&amp;gt;. A tier at the end, &amp;lt;code&amp;gt;Circuit Plate T3&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Circuit Plate [T3]&amp;lt;/code&amp;gt;, gives the name &amp;lt;code&amp;gt;Circuit Plate [T3]&amp;lt;/code&amp;gt; and the icon &amp;lt;code&amp;gt;File:Circuit Plate T3.png&amp;lt;/code&amp;gt;, shown at 32×32 pixels and pixelated. Counts above 1 show in the corner of the slot: in full below a million, then as &amp;lt;code&amp;gt;1.5E6&amp;lt;/code&amp;gt; (the E with the brand kit class &amp;lt;code&amp;gt;.tpt-num__e&amp;lt;/code&amp;gt;), and as ∞ from 1E18 or when written &amp;lt;code&amp;gt;∞&amp;lt;/code&amp;gt;. The slot count always uses this notation; it doesn&amp;#039;t follow the reader&amp;#039;s number format.&lt;br /&gt;
&lt;br /&gt;
Counts can be written in full or in E notation, with either case: &amp;lt;code&amp;gt;Plate,1500000&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Plate,1.5e6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Plate,1.5E6&amp;lt;/code&amp;gt; are the same stack.&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
* &amp;lt;code&amp;gt;slot(args)&amp;lt;/code&amp;gt;: the slot as an &amp;lt;code&amp;gt;mw.html&amp;lt;/code&amp;gt; span. &amp;lt;code&amp;gt;args[1]&amp;lt;/code&amp;gt; is a stack string or table; without it the slot is empty. &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; is the page the icon and count link to (no link when empty or &amp;lt;code&amp;gt;no&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; go on the slot, &amp;lt;code&amp;gt;itemClass&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;itemStyle&amp;lt;/code&amp;gt; on the item, &amp;lt;code&amp;gt;numStyle&amp;lt;/code&amp;gt; on the count.&lt;br /&gt;
* &amp;lt;code&amp;gt;main(frame)&amp;lt;/code&amp;gt;: the same for [[Template:Factory slot|&amp;lt;nowiki&amp;gt;{{Factory slot}}&amp;lt;/nowiki&amp;gt;]], which no page uses at the moment.&lt;br /&gt;
* &amp;lt;code&amp;gt;parseStack(text)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;stringifyStack(stack)&amp;lt;/code&amp;gt;: convert between stack strings and &amp;lt;code&amp;gt;{ name, count }&amp;lt;/code&amp;gt; tables.&lt;br /&gt;
* &amp;lt;code&amp;gt;formatCount(count)&amp;lt;/code&amp;gt;: the count text, or &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; for counts below 2.&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- Categories below this line --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Speedybrain</name></author>
	</entry>
</feed>