This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
component:redstone [2016/01/05 23:58] sylphio |
component:redstone [2016/01/06 00:00] sylphio |
||
---|---|---|---|
Line 10: | Line 10: | ||
- `getInput(side: number): number` | - `getInput(side: number): number` | ||
Gets the current ingoing redstone signal from the specified [[api:sides|side]]. Note that the side is relative to the computer's orientation, i.e. `sides.south` is *in front of the computer*, not south in the world. Likewise, `sides.left` is to the left of the computer, so when you look at the computer's front, it'll be to your right. | Gets the current ingoing redstone signal from the specified [[api:sides|side]]. Note that the side is relative to the computer's orientation, i.e. `sides.south` is *in front of the computer*, not south in the world. Likewise, `sides.left` is to the left of the computer, so when you look at the computer's front, it'll be to your right. | ||
- | If you use mods such as RedLogic the input may exceed the vanilla values of [0, 15]. | + | If you use mods such as RedLogic the input may exceed the vanilla values of [0, 15]. |
- `getOutput(side: number): number` | - `getOutput(side: number): number` | ||
Gets the currently set output on the specified side. | Gets the currently set output on the specified side. | ||
Line 16: | Line 16: | ||
Sets the strength of the redstone signal to emit on the specified side. Returns the new value. | Sets the strength of the redstone signal to emit on the specified side. Returns the new value. | ||
This can be an arbitrarily large number for mods that support this. For vanilla interaction it is clamped to the interval [0, 15]. | This can be an arbitrarily large number for mods that support this. For vanilla interaction it is clamped to the interval [0, 15]. | ||
+ | - `getComparatorInput(side:number):number` | ||
+ | Get the comparator input on the specified side. | ||
- `getBundledInput(side: number, color: number): number` | - `getBundledInput(side: number, color: number): number` | ||
Like `getInput`, but for bundled input, reading the value for the channel with the specified [[api:colors|API/Colors]].\\ | Like `getInput`, but for bundled input, reading the value for the channel with the specified [[api:colors|API/Colors]].\\ | ||
Line 49: | Line 51: | ||
- `setWakeThreshold(threshold:number):number` | - `setWakeThreshold(threshold:number):number` | ||
Sets the wake-up threshold to the specified number. | Sets the wake-up threshold to the specified number. | ||
- | - `getComparatorInput(side:number:number):number` | ||
- | Get the comparator input on the specified side. | ||
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. | 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. |