This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
component:redstone [2015/01/14 23:40] 127.0.0.1 external edit |
component:redstone [2015/08/29 17:44] flying_lizard Added call to setBundledOutput using tables |
||
---|---|---|---|
Line 17: | Line 17: | ||
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]. | ||
- `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 [[color|API/Colors]].\\ | + | Like `getInput`, but for bundled input, reading the value for the channel with the specified [[api:colors|API/Colors]].\\ |
//As of OC 1.3: only available on a tier two redstone card.// | //As of OC 1.3: only available on a tier two redstone card.// | ||
- `getBundledOutput(side: number, color: number): number` | - `getBundledOutput(side: number, color: number): number` | ||
- | Like `getOutput`, but for bundled output, getting the value for the channel with the specified [[color|API/Colors]].\\ | + | Like `getOutput`, but for bundled output, getting the value for the channel with the specified [[api:colors|API/Colors]].\\ |
//As of OC 1.3: only available on a tier two redstone card.// | //As of OC 1.3: only available on a tier two redstone card.// | ||
- `setBundledOutput(side: number, color: number, value: number): number` | - `setBundledOutput(side: number, color: number, value: number): number` | ||
- | Like `setOutput`, but for bundled output, setting the value for the channel with the specified [[color|API/Colors]].\\ | + | Like `setOutput`, but for bundled output, setting the value for the channel with the specified [[api:colors|API/Colors]].\\ |
+ | //As of OC 1.3: only available on a tier two redstone card.// | ||
+ | - `setBundledOutput(side: number, values:table):boolean` | ||
+ | Shortcut to set the value of all colors at once. Expects a table with 16 fields, where the index corresponds with the number of the color as documented in [[api:colors|API/Colors]]. Always returns true. | ||
+ | //Warning:// By default, Lua start indexing tables with 1, so when you enter something along the lines of {15,0,0,[...],0} it doesn't activate white as expected, but orange. | ||
+ | Manually set your indices to circumvent this. | ||
//As of OC 1.3: only available on a tier two redstone card.// | //As of OC 1.3: only available on a tier two redstone card.// | ||
- `getWirelessInput():number` | - `getWirelessInput():number` | ||
Line 40: | Line 45: | ||
Set the wireless redstone frequency to use.\\ | Set the wireless redstone frequency to use.\\ | ||
//Added in OC 1.3. Only available on tier two redstone cards.// | //Added in OC 1.3. Only available on tier two redstone cards.// | ||
+ | - `getWakeThreshold():number` | ||
+ | Gets the current wake-up threshold. | ||
+ | - `setWakeThreshold(threshold:number):number` | ||
+ | Sets the wake-up threshold to the specified number. | ||
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. |