<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=Component%2Fgenerator</id>
	<title>Component/generator - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=Component%2Fgenerator"/>
	<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=Component/generator&amp;action=history"/>
	<updated>2026-08-24T13:47:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://ocr.michiyo.me/w/index.php?title=Component/generator&amp;diff=1164&amp;oldid=prev</id>
		<title>imported&gt;OCDoc Import: Imported from legacy OpenComputers documentation at ocdoc.cil.li</title>
		<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=Component/generator&amp;diff=1164&amp;oldid=prev"/>
		<updated>2026-08-24T08:08:27Z</updated>

		<summary type="html">&lt;p&gt;Imported from legacy OpenComputers documentation at ocdoc.cil.li&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Component: Generator =&lt;br /&gt;
&lt;br /&gt;
This component is provided by the [[Item/generator upgrade|generator upgrade]] for robots. Generators have an internal inventory that can store one item stack of fuel items. This API allows interaction with that inventory.&lt;br /&gt;
&lt;br /&gt;
Component name: `generator`. Callbacks:&lt;br /&gt;
&lt;br /&gt;
* `count(): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;The current number of fuel items still in the generator.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `insert([count: number]): boolean[, string]`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Inserts up to the specified number of fuel items from the currently selected inventory slot into the generator&amp;#039;s inventory. Returns `true` if at least one item was moved to the generator&amp;#039;s inventory. Returns `false` and an error message otherwise.  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Possible error messages are: _&amp;quot;selected slot does not contain fuel&amp;quot;_ if the selected slot has no item which can be burnt _&amp;quot;different fuel type already queued&amp;quot;_ if there is already another type of item in the generator _&amp;quot;queue is full&amp;quot;_ if there already are 64 items of that type in the generator - `remove([count: number]): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Removes up to the specified number of fuel items from the generator and places them into the currently selected slot or the first free slot after it. Returns `true` if at least one item was removed from the generator&amp;#039;s inventory, `false` otherwise.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Example use: ```lua local component = require(&amp;quot;component&amp;quot;) -- Assuming the generator was just added to a robot and -- the selected slot contains one stack of coal: local g = component.generator -- get primary generator component print(g.count()) -- 0 g.insert(1) -- true print(g.count()) -- 0 because the item was immediately consumed, generator is running now g.insert(5) print(g.count()) -- 5 g.remove() -- remove everything from the generator print(g.count()) -- 0 g.insert() -- insert everything into the generator print(g.count()) -- 63 (minus the one consumed in the beginning) ``` ==&lt;br /&gt;
&lt;br /&gt;
{{:Component/contents}}&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;OCDoc Import</name></author>
	</entry>
</feed>