<?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%2Fredstone</id>
	<title>Component/redstone - 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%2Fredstone"/>
	<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=Component/redstone&amp;action=history"/>
	<updated>2026-08-24T13:49:19Z</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/redstone&amp;diff=1192&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/redstone&amp;diff=1192&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: Redstone =&lt;br /&gt;
&lt;br /&gt;
This component represents a [[Item/redstone card|Redstone card]].&lt;br /&gt;
&lt;br /&gt;
The tier one Redstone Card only supports vanilla redstone functionality (single-line analog redstone). Tier two provides interoperation with other mods&amp;#039; redstone systems (bundled, wireless). For bundled input/output we currently only support ProjectRed for Minecraft 1.12. In older versions we supported: RedLogic, Project Red (with Version 1.1), MineFactory Reloaded. For wireless redstone, the following mods are supported: WR-CBE, SlimeVoid&amp;#039;s WR.&lt;br /&gt;
&lt;br /&gt;
= ==== get&amp;#039;&amp;#039; and set&amp;#039;&amp;#039; method overloads =&lt;br /&gt;
&lt;br /&gt;
Starting in patch release 1.7.3 the redstone component provides overloaded flavors of `getInput`, `getOuput`, `setInput`, `getBundledInput`, `getBundledOutput`, and `setBundledOutput`.&lt;br /&gt;
&lt;br /&gt;
= ==== get&amp;#039;&amp;#039; and set&amp;#039;&amp;#039; call costs =&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;get&amp;#039;&amp;#039;&amp;#039; methods are &amp;quot;direct&amp;quot; calls and are practically free. From testing I was able to call `getInput` 20,000 to 22,000 times per second.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; methods are not &amp;quot;direct&amp;quot;, and thus can only be called once per tick, at most. Thus, ~20 times per second. In addition to their indirect cost (consuming the rest of the tick) if the &amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; call changes any output levels, there is an additional delay imposed on the machine. By default &amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; calls can change outputs approximately 6 times per second.&lt;br /&gt;
&lt;br /&gt;
One of the significant advantages of using these overloaded variants is that any api call cost is paid once per call, not once per each value set.&lt;br /&gt;
&lt;br /&gt;
Component name: `redstone`. Callbacks:&lt;br /&gt;
&lt;br /&gt;
* `getInput(side: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`getInput(): table`  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Returns current incoming (non-bundled) redstone values. `getInput(side)` returns the redstone level from the specified [[API/sides|side]]. `getInput()` returns a table of redstone levels from all sides.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Note that the table returned is zero based. That is because the keys of the table are the ordinal values of the sides, and `sides.bottom` is 0.  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Note also that the side is relative to the computer&amp;#039;s orientation, i.e. `sides.south` is &amp;#039;&amp;#039;in front of the computer&amp;#039;&amp;#039;, not south in the world. Likewise, `sides.left` is to the left of the computer, so when you look at the computer&amp;#039;s front, it&amp;#039;ll be to your right.  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;If you use mods such as RedLogic the input may exceed the vanilla values of [0, 15].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
```lua lua&amp;gt; component.redstone.getInput(sides.left) 15 lua&amp;gt; component.redstone.getInput(sides.right) 4 lua&amp;gt; component.redstone.getInput() {[0]=7, 0, 0, 0, 4, 15} lua&amp;gt; component.redstone.getInput()[sides.bottom] 7 ```&lt;br /&gt;
&lt;br /&gt;
* `getOutput(side: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`getOutput(): table`  &lt;br /&gt;
Gets the currently set output on the specified side, or the set value of all sides if called with no arguments&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
```lua lua&amp;gt; component.redstone.getOutput(sides.left) 7 lua&amp;gt; component.redstone.getOutput() [sides.left] 7 ```&lt;br /&gt;
&lt;br /&gt;
* `setOutput(side: number, value: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`setOutput(values: table): table`  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Sets the strength of the redstone signal to emit. Returns the **old** value. This can be an arbitrarily large number for mods that support this. The first variant of this method takes a [[API/sides|side]] and the redstone strength to apply to just that side. `setOutput(values)` allows you to set the redstone strength of all sides (or a subset of sides) in a single call.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getBundledInput(side: number, color: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`getBundledInput(side: number): table`  &lt;br /&gt;
`getBundledInput(): table`  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Like `getInput`, but for bundled input, reading the value for the channel with the specified [[API/colors|API/Colors]].\\&lt;br /&gt;
//As of OC 1.3: only available on a tier two redstone card.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;`getBundledInput(side, color)` returns the strength of the incoming redstone value on the specified side on the specified color channel.  &lt;br /&gt;
`getBundledInput(side)` returns a table (Map[Int, Int] structure) of redstone values on the specified side in a bundled pack, indexed by color.  &lt;br /&gt;
`getBundledInput()` returns all redstone values, of all sides and all colors. It is a Map[Int, Map[Int, Int]] structure. The top level keys are in [0, 5] range, values of [[API/sides|sides]] (keep in mind sides.bottom is zero). The child map of each side is the same data structure returned by `getBundledInput(side)`.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getBundledOutput(side: number, color: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`getBundledOutput(side: number): table`  &lt;br /&gt;
`getBundledOutput(): table`  &lt;br /&gt;
Like `getOutput`, but for bundled output, getting the values previously set that the device is emitting.\\&lt;br /&gt;
//As of OC 1.3: only available on a tier two redstone card.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setBundledOutput(side: number, color: number, value: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Like `setOutput`, but for bundled output, setting the value for the channel with the specified [[API/colors|API/Colors]]. Returns the previous values set.&lt;br /&gt;
`setBundledOutput(side, values)` sets a pack of color-indexed redstone values, [0, 15]. `colors.white` is zero. The values table doesn&amp;#039;t have to be contiguous, and values omitted are left unchanged.&lt;br /&gt;
`setBundledOutput(values)` allows you to set redstone levels for any side and any color in a single api call.\\&lt;br /&gt;
//As of OC 1.3: only available on a tier two redstone card.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
```lua lua&amp;gt; component.redstone.setBundledOutput(sides.left, { [colors.white] = 15 } ) -- only sets 1 output lua&amp;gt; component.redstone.setBundledOutput({ [sides.left] = { [colors.white] = 15 } } ) -- same as above ```&lt;br /&gt;
&lt;br /&gt;
* `getComparatorInput(side:number):number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Get the comparator input on the specified side.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getWirelessInput():number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Get the wireless redstone input.\\&lt;br /&gt;
//Added in OC 1.3. Only available on tier two redstone cards.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getWirelessOutput():boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Get the wireless redstone output.\\&lt;br /&gt;
//Added in OC 1.3. Only available on tier two redstone cards.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setWirelessOutput(value:boolean):boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set the wireless redstone output.\\&lt;br /&gt;
//Added in OC 1.3. Only available on tier two redstone cards.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getWirelessFrequency():number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Get the currently set wireless redstone frequency.\\&lt;br /&gt;
//Added in OC 1.3. Only available on tier two redstone cards.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setWirelessFrequency(frequency:number):number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set the wireless redstone frequency to use.\\&lt;br /&gt;
//Added in OC 1.3. Only available on tier two redstone cards.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getWakeThreshold():number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Gets the current wake-up threshold.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setWakeThreshold(threshold:number):number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sets the wake-up threshold to the specified number.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that for mods such as ProjectRed, low values (such as the vanilla maximum of 15) may not function as expected for simple on/off values (opening a door for example), because they have a larger value range. You may need to use a higher value, such as 255.&lt;br /&gt;
&lt;br /&gt;
== Example use: ```lua local component = require(&amp;quot;component&amp;quot;) local sides = require(&amp;quot;sides&amp;quot;) local colors = require(&amp;quot;colors&amp;quot;) local rs = component.redstone -- get primary redstone component print(rs.getInput(sides.back)) rs.setBundledOutput(sides.bottom, colors.green, rs.getBundledInput(sides.top, colors.red)) ``` ==&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>